From 31e5eb7fce4ac902d05492fa3122b9e535000055 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Mon, 6 Jan 2025 12:52:46 -0500 Subject: [PATCH] Picking up gold doesn't add it to your inventory. --- systems.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systems.cpp b/systems.cpp index c3e2df0..39e9fd9 100644 --- a/systems.cpp +++ b/systems.cpp @@ -137,14 +137,14 @@ void System::collision(DinkyECS::World &world, Player &player) { auto& item_pos = world.get(entity); auto& inventory = world.get(player.entity); - inventory.add(item); - if(world.has(entity)) { + inventory.add(item); auto &new_light = world.get(entity); world.set(player.entity, new_light); inventory.light = new_light; world.remove(entity); } else if(world.has(entity)) { + inventory.add(item); auto &weapon = world.get(entity); player_combat.damage = weapon.damage; world.remove(entity);