You now click on things to interact with them.
This commit is contained in:
parent
2aa4f0a2e8
commit
7b0bac4f59
1 changed files with 3 additions and 4 deletions
|
@ -301,10 +301,6 @@ void System::collision(GameLevel &level) {
|
|||
combat_count++;
|
||||
world.send<Events::GUI>(Events::GUI::COMBAT_START, entity, entity);
|
||||
}
|
||||
} else if(world.has<InventoryItem>(entity)) {
|
||||
dbc::log("Hit an inventory item, use Sysem::pickup?");
|
||||
} else if(world.has<Device>(entity)) {
|
||||
System::device(world, player.entity, entity);
|
||||
} else {
|
||||
dbc::log(fmt::format("UNKNOWN COLLISION TYPE {}", entity));
|
||||
}
|
||||
|
@ -318,6 +314,7 @@ void System::collision(GameLevel &level) {
|
|||
|
||||
void System::pickup(GameLevel &level, DinkyECS::Entity entity) {
|
||||
auto &world = *level.world;
|
||||
auto player = world.get_the<Player>();
|
||||
|
||||
if(world.has<InventoryItem>(entity)) {
|
||||
auto item = world.get<InventoryItem>(entity);
|
||||
|
@ -335,6 +332,8 @@ void System::pickup(GameLevel &level, DinkyECS::Entity entity) {
|
|||
level.collision->remove(item_pos.location);
|
||||
world.remove<Tile>(entity);
|
||||
world.send<Events::GUI>(Events::GUI::LOOT, entity, item);
|
||||
} else if(world.has<Device>(entity)) {
|
||||
System::device(world, player.entity, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue