Prep for fixing the spatialmap to allow for entities without collision to still be in the space.
This commit is contained in:
parent
d93bc1615c
commit
fd53f92fe6
7 changed files with 27 additions and 53 deletions
18
systems.cpp
18
systems.cpp
|
@ -106,24 +106,6 @@ void System::enemy_pathing(GameLevel &level) {
|
|||
map.clear_target(player_position.location);
|
||||
}
|
||||
|
||||
void System::init_positions(World &world, SpatialMap &collider) {
|
||||
auto player = world.get_the<Player>();
|
||||
auto& inv = world.get<inventory::Model>(player.entity);
|
||||
|
||||
world.query<Position>([&](auto ent, auto &pos) {
|
||||
if(world.has<Combat>(ent)) {
|
||||
const auto& combat = world.get<Combat>(ent);
|
||||
if(!combat.dead) {
|
||||
collider.insert(pos.location, ent);
|
||||
}
|
||||
} else {
|
||||
dbc::check(!inv.has(ent),
|
||||
fmt::format("!!! Entity {} is in player inventory and _also_ has a position in the world.", ent));
|
||||
|
||||
collider.insert(pos.location, ent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
inline void move_entity(SpatialMap &collider, Map &game_map, Position &position, Motion &motion, Entity ent) {
|
||||
Point move_to = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue