mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 23:57:32 +00:00
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.
This commit is contained in:
parent
cac4dfe8e4
commit
183571f7c2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user