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:
Bastien Bouclet 2017-11-20 20:19:15 +01:00
parent cac4dfe8e4
commit 183571f7c2

View File

@ -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;