Fix: when buying gear kits from AIM/MERC, prices are incorrect for item stacks

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8349 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-12-30 00:09:15 +00:00
parent 200899593e
commit d6b7dd4d52
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -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
+7 -1
View File
@@ -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