From 9353bf27a19c7dccb8a1375152ce60bb110d38ce Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Fri, 19 Jun 2026 21:58:41 +0300 Subject: [PATCH] Revert "Make new kit selection respect TonsOfGuns & Scifi tags" This reverts commit 69904ee003631cb005ed3086755b11fe32cad77c. --- Laptop/AimMembers.cpp | 89 +++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 58 deletions(-) diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index 55e02be4..3733dbaa 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -5735,38 +5735,21 @@ void WeaponKitSelectionUpdate(UINT8 selectedInventory = 0) { UINT32 uiLoop; INT16 usItem; - const bool realisticGameStyle = gGameOptions.ubGameStyle != STYLE_SCIFI; - const bool reducedGuns = gGameOptions.fGunNut == false; - - auto& currentGear = gMercProfiles[gbCurrentSoldier]; - auto& selectedGearSet = gMercProfileGear[gbCurrentSoldier][selectedInventory]; - if(UsingNewInventorySystem() == true){ // Start by resetting all profile inventory values to 0 - currentGear.clearInventory(); - currentGear.ubInvUndroppable = 0; + gMercProfiles[gbCurrentSoldier].clearInventory(); + gMercProfiles[gbCurrentSoldier].ubInvUndroppable = 0; // Next, go through and assign everything but lbe gear for(uiLoop=INV_START_POS; uiLoop 5) - currentGear.bInvNumber[uiLoop] = selectedGearSet.iNumber[uiLoop]; + gMercProfiles[gbCurrentSoldier].bInvNumber[uiLoop] = gMercProfileGear[gbCurrentSoldier][selectedInventory].iNumber[uiLoop]; else - currentGear.bInvNumber[uiLoop] = 1; + gMercProfiles[gbCurrentSoldier].bInvNumber[uiLoop] = 1; } } // Last, go through and assign LBE items. Only needed for new inventory system @@ -5775,87 +5758,77 @@ void WeaponKitSelectionUpdate(UINT8 selectedInventory = 0) for(uiLoop=0; uiLoop<5; uiLoop++) { UINT32 uiLoop2 = uiLoop + VESTPOCKPOS; - if(selectedGearSet.lbe[uiLoop] != NONE){ - if ( realisticGameStyle && ItemIsOnlyInScifi(selectedGearSet.lbe[uiLoop]) ) - { - continue; - } - - if ( reducedGuns && ItemIsOnlyInTonsOfGuns(selectedGearSet.lbe[uiLoop]) ) - { - continue; - } - - currentGear.inv[uiLoop2] = selectedGearSet.lbe[uiLoop]; - currentGear.bInvStatus[uiLoop2] = selectedGearSet.lStatus[uiLoop]; - currentGear.bInvNumber[uiLoop2] = 1; + if(gMercProfileGear[gbCurrentSoldier][selectedInventory].lbe[uiLoop] != NONE){ + gMercProfiles[gbCurrentSoldier].inv[uiLoop2] = gMercProfileGear[gbCurrentSoldier][selectedInventory].lbe[uiLoop]; + gMercProfiles[gbCurrentSoldier].bInvStatus[uiLoop2] = gMercProfileGear[gbCurrentSoldier][selectedInventory].lStatus[uiLoop]; + gMercProfiles[gbCurrentSoldier].bInvNumber[uiLoop2] = 1; } } } } - currentGear.bMainGunAttractiveness = -1; - currentGear.bArmourAttractiveness = -1; + gMercProfiles[gbCurrentSoldier].bMainGunAttractiveness = -1; + gMercProfiles[gbCurrentSoldier].bArmourAttractiveness = -1; - UINT32 invsize = currentGear.inv.size(); + UINT32 invsize = gMercProfiles[ gbCurrentSoldier ].inv.size(); for ( uiLoop = 0; uiLoop < invsize; ++uiLoop ) { - usItem = currentGear.inv[ uiLoop ]; + usItem = gMercProfiles[gbCurrentSoldier].inv[ uiLoop ]; if ( usItem != NOTHING ) { // Check if it's a gun if ( Item[ usItem ].usItemClass & IC_GUN ) { - currentGear.bMainGunAttractiveness = Weapon[ usItem ].ubDeadliness; + gMercProfiles[gbCurrentSoldier].bMainGunAttractiveness = Weapon[ usItem ].ubDeadliness; } // If it's armour if ( Item[ usItem ].usItemClass & IC_ARMOUR ) { - currentGear.bArmourAttractiveness = min(128,Armour[ Item[ usItem ].ubClassIndex ].ubProtection); + gMercProfiles[gbCurrentSoldier].bArmourAttractiveness = min(128,Armour[ Item[ usItem ].ubClassIndex ].ubProtection); } } } - currentGear.usOptionalGearCost = 0; + gMercProfiles[ gbCurrentSoldier ].usOptionalGearCost = 0; //tais: new tag in gearkit that sets an absolute price for gearkit that will override item value and price modifier if it's a sensible value between 0 and 32000 - if(selectedGearSet.AbsolutePrice >= 0 && selectedGearSet.AbsolutePrice <= 32000) + if(gMercProfileGear[gbCurrentSoldier][selectedInventory].AbsolutePrice >= 0 && gMercProfileGear[gbCurrentSoldier][selectedInventory].AbsolutePrice <= 32000) { - currentGear.usOptionalGearCost = selectedGearSet.AbsolutePrice; + gMercProfiles[ gbCurrentSoldier ].usOptionalGearCost = gMercProfileGear[gbCurrentSoldier][selectedInventory].AbsolutePrice; } else { UINT16 tempGearCost = 0; - UINT32 invsize = currentGear.inv.size(); + UINT32 invsize = gMercProfiles[ gbCurrentSoldier ].inv.size(); for ( uiLoop = 0; uiLoop< invsize; ++uiLoop ) { - if ( currentGear.inv[ uiLoop ] != NOTHING ) + if ( gMercProfiles[ gbCurrentSoldier ].inv[ uiLoop ] != NOTHING ) { //get the item - usItem = currentGear.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 ( selectedGearSet.iNumber.size( ) >= uiLoop ) - number = max( 1, selectedGearSet.iNumber[uiLoop] ); + if ( gMercProfileGear[gbCurrentSoldier][selectedInventory].iNumber.size( ) >= uiLoop ) + number = max( 1, gMercProfileGear[gbCurrentSoldier][selectedInventory].iNumber[uiLoop] ); //add the cost tempGearCost += number * Item[usItem].usPrice; } } //tais: added optional price modifier for gearkits, reads the xml tag mPriceMod from MercStartingGear.xml - if(selectedGearSet.PriceModifier != 0 && - selectedGearSet.PriceModifier <= 200 && - selectedGearSet.PriceModifier >= -100) + if(gMercProfileGear[gbCurrentSoldier][selectedInventory].PriceModifier != 0 && + gMercProfileGear[gbCurrentSoldier][selectedInventory].PriceModifier <= 200 && + gMercProfileGear[gbCurrentSoldier][selectedInventory].PriceModifier >= -100) { FLOAT mod; - mod = (FLOAT) (selectedGearSet.PriceModifier + 100) / 100; - currentGear.usOptionalGearCost = (UINT16)(tempGearCost * mod); + mod = (FLOAT) (gMercProfileGear[gbCurrentSoldier][selectedInventory].PriceModifier + 100) / 100; + gMercProfiles[ gbCurrentSoldier ].usOptionalGearCost = (UINT16)(tempGearCost * mod); } else { - currentGear.usOptionalGearCost = tempGearCost; + gMercProfiles[ gbCurrentSoldier ].usOptionalGearCost = tempGearCost; } } }