From 374b125ffc5eb27c53997e529d7edef0d6d36891 Mon Sep 17 00:00:00 2001 From: rftr Date: Fri, 18 Mar 2022 06:40:36 +0000 Subject: [PATCH] fix initial gearkit costs for AIM members (thanks Toni) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9330 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Profile.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index fc1aeeba0..f9fbce1a7 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -804,8 +804,15 @@ BOOLEAN LoadMercProfiles(void) //get the item usItem = gMercProfiles[ uiLoop ].inv[ uiLoop2 ]; + // 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... + // initialise to first gearkit + int number = 1; + if ( gMercProfileGear[uiLoop][0].iNumber.size( ) >= uiLoop2 ) + number = max( 1, gMercProfileGear[uiLoop][0].iNumber[uiLoop2] ); + //add the cost - tempGearCost += Item[ usItem ].usPrice; + tempGearCost += (Item[ usItem ].usPrice * number); } } //tais: added optional price modifier for gearkits, reads the xml tag mPriceMod from MercStartingGear.xml