Make the AI Condition bTestTargetEffectsApply work properly and allow it to be used with grenades #1451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1369
This is an alternative approach to the original issue of allowing mods to specifically exclude the lost from AOE targetting profiles and centres around some findings from testing, wherein XGAIBehavior::GetAllAoETargets was incorrecly adding a bunch of units to its out array, which should have been filtered out when bTestTargetEffectsApply was set on the AOE profile in XCOMAI.ini. Furthermore, the same function was also not capable of checking the area of effect profiles of grenades, as it was only set up to look directly at multitargeteffects on the ability templates (which for launchgrenade and throwgrenade, don't exist).
It could be argued that this is a bugfix - strictly speaking, but basically the only abilities in the base game which use this part of the function are Harbor Wave and the Purifier Flamethrower and the only base-game effect the oversight would've had, is that purifiers would probably try to fire at things even if they have fire immunity (the assasin's harbor wave has a unique damage type which I don't think anything is immune to anyway).
With the fix in place, enemy & AI modders can simply specify bTestTargetEffectsApply on their AOE Profiles in the AI templates and that should be sufficient to prevent those abilities being used against units which are immune to the effects (whether those are created via multi-target effects, or by making additional grenades / rockets).