mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
@@ -5972,8 +5972,14 @@ void WeaponKitSelectionUpdate(UINT8 selectedInventory = 0)
|
|||||||
//get the item
|
//get the item
|
||||||
usItem = gMercProfiles[ gbCurrentSoldier ].inv[ uiLoop ];
|
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
|
//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
|
//tais: added optional price modifier for gearkits, reads the xml tag mPriceMod from MercStartingGear.xml
|
||||||
|
|||||||
@@ -1854,8 +1854,14 @@ void MercWeaponKitSelectionUpdate(UINT8 selectedInventory)
|
|||||||
//get the item
|
//get the item
|
||||||
usItem = gMercProfiles[ ubMercID ].inv[ uiLoop ];
|
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
|
//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
|
//tais: added optional price modifier for gearkits, reads the xml tag mPriceMod from MercStartingGear.xml
|
||||||
|
|||||||
Reference in New Issue
Block a user