Closed GingerAvalanche closed 6 years ago
CheckToUpgradePrimaryWeapons
became unreadable due to spacing issues. Leaving existing function untouched, removing call to it and replacing with call to new function, CheckToUpgradeItems
.
In order to offset the increased time added by the first proposed change, the second proposed change has evolved: Instead of modifying the original check, rewrote it completely. Now uses the item template manager's GetUpgradedItemTemplateFromBase
to find the upgraded item directly, instead of iterating over a list.
(No changes have been pushed to the fork, in the event this fix is outside the scope of the highlander and should be taken care of in a separate mod.)
Maybe you could include Issue #153.
Separate purpose, I'd think. This is a bug fix, #153 is a feature. I can implement and complete that issue, though.
According to users, the infinite loop issue was fixed. Closing the issue.
X2StrategyElement_XPackStaffSlots:CheckToUpgradePrimaryWeapon
currently only checks for the highest tier of the matching weapon category that is in HQ inventory when upgrading weapons, resulting in the possibility of weapon attachments and customization being transferred to the wrong weapon type when a soldier returns from a covert mission.Propose to change two things: 1) Expand the check to all inventory items, to provide support for mods which allow attachments and customization for items other than primary weapons, such as Mod Everything. 2) Add a third condition to the check: the BaseItem of the BestWeaponTemplate and any subsequent BaseItems for as long as any remain, to ensure the item being upgraded to is actually an upgraded version of the currently-held weapon. Subsequent BaseItems included for rare cases where a player may upgrade multiple tiers, for example conventional to plasma, during the course of one covert ops mission.