diff --git a/systems.cpp b/systems.cpp index eb0fc92..daec0df 100644 --- a/systems.cpp +++ b/systems.cpp @@ -146,22 +146,19 @@ void System::distribute_loot(GameLevel &level, Position target_pos) { if(inventory_count > 0) { auto pile = ritual::random_junk(config, inventory_count); - auto entity_data = config.devices["GRAVE_STONE"]; + auto entity_data = config.devices["DEAD_BODY_LOOTABLE"]; components::configure_entity(world, loot_entity, entity_data["components"]); world.set(loot_entity, pile); // BUG: inventory_count here isn't really used to remove it world.set(loot_entity, {inventory_count, entity_data}); - - set_position(world, *level.collision, loot_entity, target_pos); - - level.world->send(Events::GUI::ENTITY_SPAWN, loot_entity, {}); } else { // this creates a dead body on the ground auto entity_data = config.devices["DEAD_BODY"]; components::configure_entity(world, loot_entity, entity_data["components"]); - set_position(world, *level.collision, loot_entity, target_pos); - level.world->send(Events::GUI::ENTITY_SPAWN, loot_entity, {}); } + + set_position(world, *level.collision, loot_entity, target_pos); + level.world->send(Events::GUI::ENTITY_SPAWN, loot_entity, {}); } void System::death(GameLevel &level) {