HomeWildfire Games

Let entity react on target death directly.
AuditedrP25368

Description

Let entity react on target death directly.

Don't let entities waste a repeat time when they've killed their target.
Done by storing a list of attackers in cmpResistance (since that cmp is obligatory anyway).

Differential revision: https://code.wildfiregames.com/D2129
Comments by: @Angen, @wraitii

Event Timeline

bb raised a concern with this commit.Sep 5 2021, 11:30 PM
bb added a subscriber: bb.
bb added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/components/Attack.js
458–461

Same concern as reased in rP25465 pops up here: attack a mirage with some ranged units (archers vs cc worked for me) and you will see that the units that arrive first try to capture (since the become idle) other than use the ranged attack (when giving the ranged attack order).

I guess we need to replace the target by the parent in case it is a mirage for the entire function here. Reminds me of rP24005.

This commit now has outstanding concerns.Sep 5 2021, 11:30 PM
Freagarach added inline comments.Sep 9 2021, 6:50 PM
/ps/trunk/binaries/data/mods/public/simulation/components/Attack.js
458–461

The problem is if you add the attacker to the parent, and the parent dies, the attacker will stop attacking. I guess we need to also mock this function in the mirage and query that?

Freagarach requested verification of this commit.Oct 12 2021, 5:27 PM
This commit now requires verification by auditors.Oct 12 2021, 5:27 PM
bb accepted this commit.Oct 12 2021, 5:29 PM

concern fixed by rP25914

All concerns with this commit have now been addressed.Oct 12 2021, 5:29 PM