Inventory system is mostly working and I can pick up everything and use it.
This commit is contained in:
parent
aaa6d9f9f3
commit
14b3ea7676
8 changed files with 56 additions and 47 deletions
|
@ -150,6 +150,10 @@ void System::collision(DinkyECS::World &world, Player &player) {
|
|||
auto &weapon = world.get<Weapon>(entity);
|
||||
player_combat.damage = weapon.damage;
|
||||
world.remove<Weapon>(entity);
|
||||
} else if(world.has<Loot>(entity)) {
|
||||
auto &loot = world.get<Loot>(entity);
|
||||
inventory.gold += loot.amount;
|
||||
world.remove<Loot>(entity);
|
||||
}
|
||||
|
||||
collider.remove(item_pos.location);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue