Skip to content

Commit

Permalink
FULLPIPE: Fix loading inventory items from saves
Browse files Browse the repository at this point in the history
In C++ the function parameter evaluation order is undefined. The count
property was being read first from the stream, instead of the itemId.

Fixes #10324.
  • Loading branch information
bgK committed Nov 20, 2017
1 parent cac4dfe commit 183571f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engines/fullpipe/inventory.cpp
Expand Up @@ -95,7 +95,9 @@ bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartiall
int numInvs = file.readUint32LE();

for (int i = 0; i < numInvs; i++) {
_inventoryItems.push_back(InventoryItem(file.readUint16LE(), file.readUint16LE()));
int16 itemId = file.readUint16LE();
int16 count = file.readUint16LE();
_inventoryItems.push_back(InventoryItem(itemId, count));
}

return true;
Expand Down

0 comments on commit 183571f

Please sign in to comment.