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