Slight clean up.
This commit is contained in:
parent
521180b086
commit
8594568ff4
1 changed files with 4 additions and 7 deletions
|
@ -146,23 +146,20 @@ 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<ritual::JunkPile>(loot_entity, pile);
|
||||
// BUG: inventory_count here isn't really used to remove it
|
||||
world.set<InventoryItem>(loot_entity, {inventory_count, entity_data});
|
||||
|
||||
set_position(world, *level.collision, loot_entity, target_pos);
|
||||
|
||||
level.world->send<Events::GUI>(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>(Events::GUI::ENTITY_SPAWN, loot_entity, {});
|
||||
}
|
||||
}
|
||||
|
||||
void System::death(GameLevel &level) {
|
||||
auto &world = *level.world;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue