X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

Make it so the [!] icon in the PCS tab appears only if a PCS slot is empty. #1345

Closed Larryturbo closed 1 week ago

Larryturbo commented 4 months ago

Fixes #1348 For the weapon mods the little [!] icon appears in a soldier's list only if there's an empty slot for a mod. The same isn't true for the PCS tab. After researching "Interchangeable PCSs" the orange [!] will remain there permanently for every soldier that can equip PCSs. This isn't exactly a bug but it's not useful to have the game constantly tell the player that they can swap a soldier's equipped PCS with one that might even be worse, just because there is an unused PCS in the player's inventory.

RustyDios commented 4 months ago

surely this should be; PCSAvailabilityData.bNoCombatSimsEquipped = ( EquippedImplants.Length <= 0 );

chrishayesmu commented 4 months ago

surely this should be; PCSAvailabilityData.bNoCombatSimsEquipped = ( EquippedImplants.Length <= 0 );

I think the logic is right, but the name is wrong. It should be something like bHasEmptyCombatSimSlots.

RustyDios commented 4 months ago

which is what PCSAvailabilityData.bHasCombatSimsSlotsAvailable does?

RustyDios commented 4 months ago

oh! see this is where the issue is because of the || XComHQ.bReusePCS; right ?

Larryturbo commented 4 months ago

oh! see this is where the issue is because of the || XComHQ.bReusePCS; right ?

Yes because of that, once you finish the research, bHasNeurochipImplantsInInventory becomes the only condition for the [!] to show for every single soldier, which is practically always, unless you go and sell every extra PCS you can't immediately equip. I didn't want to alter the original variable since it has other uses, bHasEmptyCombatSimSlots is a better name for what it checks but then it'll have the same name as bHasCombatSimsSlotsAvailable. The logic is correct, the same as bHasCombatSimsSlotsAvailable without the OR, in case some mod adds more slots or something.