Initial changes to clean up the code.

This commit is contained in:
Zed A. Shaw 2025-01-10 11:12:14 -05:00
parent 8d3ccd935d
commit f3f875ee80
8 changed files with 21 additions and 29 deletions

View file

@ -191,7 +191,8 @@ DinkyECS::Entity place_combatant(DinkyECS::World &world, Map &game_map, std::str
auto &config = world.get_the<GameConfig>();
auto enemy = world.entity();
auto enemy_data = config.enemies[name];
world.set<Position>(enemy, {game_map.place_entity(in_room)});
auto pos = game_map.place_entity(in_room);
world.set<Position>(enemy, {pos});
if(enemy_data.contains("components")) {
components::configure(world, enemy, enemy_data);