Picking up gold doesn't add it to your inventory.

This commit is contained in:
Zed A. Shaw 2025-01-06 12:52:46 -05:00
parent 8e4add25a9
commit 31e5eb7fce

View file

@ -137,14 +137,14 @@ void System::collision(DinkyECS::World &world, Player &player) {
auto& item_pos = world.get<Position>(entity);
auto& inventory = world.get<Inventory>(player.entity);
inventory.add(item);
if(world.has<LightSource>(entity)) {
inventory.add(item);
auto &new_light = world.get<LightSource>(entity);
world.set<LightSource>(player.entity, new_light);
inventory.light = new_light;
world.remove<LightSource>(entity);
} else if(world.has<Weapon>(entity)) {
inventory.add(item);
auto &weapon = world.get<Weapon>(entity);
player_combat.damage = weapon.damage;
world.remove<Weapon>(entity);