aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorBastien Bouclet2017-11-20 20:19:15 +0100
committerBastien Bouclet2017-11-20 20:22:32 +0100
commit183571f7c2292b78f8e632cb4de01ff108bf207c (patch)
tree4670077795c4d609115b808a8f492706da19526e /engines/fullpipe
parentcac4dfe8e4341bfbfb15db32ab3a610fde416edf (diff)
downloadscummvm-rg350-183571f7c2292b78f8e632cb4de01ff108bf207c.tar.gz
scummvm-rg350-183571f7c2292b78f8e632cb4de01ff108bf207c.tar.bz2
scummvm-rg350-183571f7c2292b78f8e632cb4de01ff108bf207c.zip
FULLPIPE: Fix loading inventory items from saves
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.
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/inventory.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 7cf8fe9712..1a3c234ef6 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -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;