Tracked down the bug that was caused by picking up an item but not removing its Position in the world, so when you go to another level it gets brought back to life causing a dupe.
This commit is contained in:
parent
2c6565c40a
commit
e0588847fa
7 changed files with 62 additions and 5 deletions
|
@ -94,13 +94,16 @@ namespace gui {
|
|||
}
|
||||
}
|
||||
|
||||
void LootUI::remove_slot(DinkyECS::Entity slot_id) {
|
||||
void LootUI::remove_slot(guecs::Entity slot_id) {
|
||||
auto& name = $slot_to_name.at(slot_id);
|
||||
fmt::println("LootUI remove slot inv::Model id={} slot={}", $target, name);
|
||||
System::remove_from_container(*$level.world, $target, name);
|
||||
update();
|
||||
}
|
||||
|
||||
bool LootUI::place_slot(guecs::Entity id, DinkyECS::Entity world_entity) {
|
||||
fmt::println("LootUI target={} placing world entity {} in slot id {}",
|
||||
$target, id, world_entity);
|
||||
auto& name = $slot_to_name.at(id);
|
||||
bool worked = System::place_in_container(*$level.world, $target, name, world_entity);
|
||||
if(worked) update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue