diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index 09749c66..d6a4fdb7 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -5972,8 +5972,14 @@ void WeaponKitSelectionUpdate(UINT8 selectedInventory = 0) //get the item usItem = gMercProfiles[ gbCurrentSoldier ].inv[ uiLoop ]; + // for an item stack, we obviously need to account fot the number of items + // for single items, the number is not always set, so just to be sure... + int number = 1; + if ( gMercProfileGear[gbCurrentSoldier][selectedInventory].iNumber.size( ) >= uiLoop ) + number = max( 1, gMercProfileGear[gbCurrentSoldier][selectedInventory].iNumber[uiLoop] ); + //add the cost - tempGearCost += Item[ usItem ].usPrice; + tempGearCost += number * Item[usItem].usPrice; } } //tais: added optional price modifier for gearkits, reads the xml tag mPriceMod from MercStartingGear.xml diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index 864180cd..0c84ddf9 100644 --- a/Laptop/mercs Files.cpp +++ b/Laptop/mercs Files.cpp @@ -1854,8 +1854,14 @@ void MercWeaponKitSelectionUpdate(UINT8 selectedInventory) //get the item usItem = gMercProfiles[ ubMercID ].inv[ uiLoop ]; + // for an item stack, we obviously need to account fot the number of items + // for single items, the number is not always set, so just to be sure... + int number = 1; + if ( gMercProfileGear[ubMercID][selectedInventory].iNumber.size( ) >= uiLoop ) + number = max( 1, gMercProfileGear[ubMercID][selectedInventory].iNumber[uiLoop] ); + //add the cost - tempGearCost += Item[ usItem ].usPrice; + tempGearCost += number * Item[usItem].usPrice; } } //tais: added optional price modifier for gearkits, reads the xml tag mPriceMod from MercStartingGear.xml