Skip to content

Commit

Permalink
Fix compilation erros on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptsengineer committed Dec 1, 2024
1 parent 2a7c58e commit 28a48e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/core/grid_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,16 +426,18 @@ bool GridInventory::sort() {

Dictionary GridInventory::serialize() const {
Dictionary data = Inventory::serialize();
Variant stack_pos_var = stack_positions.duplicate();
Variant stack_rot_var = stack_positions.duplicate();
data["stack_positions"] = stack_pos_var;
data["stack_rotations"] = stack_rot_var;
data["stack_positions"] = stack_positions.duplicate();
data["stack_rotations"] = stack_positions.duplicate();
return data;
}

void GridInventory::deserialize(const Dictionary data) {
stack_positions = data["stack_positions"];
stack_rotations = data["stack_rotations"];
Variant stack_positions_var = data["stack_positions"];
Variant stack_rotations_var = data["stack_rotations"];

stack_positions = stack_positions_var;
stack_rotations = stack_rotations_var;

Inventory::deserialize(data);
for (size_t i = 0; i < stack_positions.size(); i++) {
Ref<ItemStack> stack = stacks[i];
Expand Down
2 changes: 1 addition & 1 deletion src/core/hotbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void Hotbar::_on_contents_changed() {
int stack_index = inventory->get_stacks().find(stack);
if (stack_index == -1) {
slot->clear();
emit_signal("equipped_stack_changed", i);
emit_signal("equipped_stack_changed", ((int)i));
unequip(i);
}
}
Expand Down

0 comments on commit 28a48e8

Please sign in to comment.