diff options
author | Bastien Bouclet | 2017-11-20 20:19:15 +0100 |
---|---|---|
committer | Bastien Bouclet | 2017-11-20 20:22:32 +0100 |
commit | 183571f7c2292b78f8e632cb4de01ff108bf207c (patch) | |
tree | 4670077795c4d609115b808a8f492706da19526e /engines/fullpipe | |
parent | cac4dfe8e4341bfbfb15db32ab3a610fde416edf (diff) | |
download | scummvm-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.cpp | 4 |
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; |