X2CommunityCore / X2WOTCCommunityHighlander

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

Highlander is automatically upgrading buildable items at end of covert actions #992

Open pledbrook opened 3 years ago

pledbrook commented 3 years ago

The implementation of #230 means that certain items are being upgraded at the end of covert actions even when a mod like LWOTC has schematics disabled. See the LWOTC workaround for this bug for a bit more detail on that.

I'm not sure at this point what the appropriate behaviour should be, but the author of the above pull request is probably right in that items should not be upgraded if the target is not tagged as infinite.

robojumper commented 3 years ago

Upgrading non-infinite items is needed for weapons from the Alien Hunters DLC. Otherwise it's possible to permanently lock yourself out of the higher-tier Alien Hunters weapons by buying the upgrade when the weapon is on a covert action.

That said, #230 needs docs and various workarounds could be documented there.

Iridar commented 3 years ago

The solution seems easy, you just have to go one step further. When you're "killing" a schematic template, scan all weapon templates and for those that have that schematic template as CreatorTemplate, zero out BaseItem and UpgradeItem properties. In my opinion there's no reason to adjust highlander behavior in this matter.

pledbrook commented 3 years ago

Trying to avoid that as at least one mod is using BaseItem for something different, which breaks with LWOTC if we clear it.

Iridar commented 3 years ago

Trying to avoid that as at least one mod is using BaseItem for something different, which breaks with LWOTC if we clear it.

Uhh can you please give the specifics? I'm curious. Although I'd say that BaseItem was ever intended to be used for upgrading items, so it's that mod's problem if it gets broken for using it for something different.

cannonfodder1 commented 3 years ago

Strategy Overhaul's single built items seem to be unaffected by this issue. Interestingly, we don't delete the BaseItem and UpgradeItem properties during our schematic conversion process. Reference: https://github.com/WOTCStrategyOverhaul/PrototypeArmoury/blob/bef0c4275669624694894fc58f647fc0108b0a24/PrototypeArmoury/Src/PrototypeArmoury/Classes/PATemplateMods.uc#L68