So far most of the bugs are solved but there's still some edge cases in the inventory dance.
This commit is contained in:
parent
e0588847fa
commit
3c5021e4c9
6 changed files with 40 additions and 25 deletions
|
@ -103,18 +103,16 @@ namespace gui {
|
|||
auto& slot_name = $slot_to_name.at(gui_id);
|
||||
auto& inventory = $level.world->get_the<inventory::Model>();
|
||||
|
||||
for(auto [ent, slot] : inventory.by_entity) {
|
||||
fmt::println("BY_ENTITY: ent={}, slot={}", ent, slot);
|
||||
}
|
||||
inventory.dump();
|
||||
|
||||
for(auto [slot, ent] : inventory.by_slot) {
|
||||
fmt::println("BY_SLOT: ent={}, slot={}", ent, slot);
|
||||
if(inventory.add(slot_name, world_entity)) {
|
||||
$level.world->make_constant(world_entity);
|
||||
update();
|
||||
return true;
|
||||
} else {
|
||||
dbc::log("there's something there already");
|
||||
return false;
|
||||
}
|
||||
|
||||
$level.world->make_constant(world_entity);
|
||||
inventory.add(slot_name, world_entity);
|
||||
update();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StatusUI::drop_item(DinkyECS::Entity item_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue