Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Inventory: make sorting more robust against inconsistent inventories.

  • Loading branch information...
commit c6220e011f3547979a54e41f4426af3b2756e53c 1 parent 4bbe6e1
Daniel Scharrer dscharrer authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/game/Inventory.cpp
4 src/game/Inventory.cpp
View
@@ -651,10 +651,12 @@ void PlayerInventory::optimize() {
for(size_t j = 0 ; j < INVENTORY_Y; j++) {
for(size_t i = 0 ; i < INVENTORY_X; i++) {
INTERACTIVE_OBJ * io = inventory[bag][i][j].io;
- if(io) {
+ if(io && inventory[bag][i][j].show) {
items.push_back(io);
removeAt(io, Pos(bag, i, j));
}
+ inventory[bag][i][j].io = NULL;
+ inventory[bag][i][j].show = 0;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.