HomeWildfire Games

add allowCapture argument to moveAttack (and patrol) commands
AuditedrP20665

Description

add allowCapture argument to moveAttack (and patrol) commands

Discussed with elexis

Differential Revision: https://code.wildfiregames.com/D1150

Event Timeline

elexis added a subscriber: elexis.Dec 19 2017, 9:39 PM
elexis added inline comments.
/ps/trunk/binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js
311

Gives me a reason to play this map again. (Besides the mauryan rams)

/ps/trunk/binaries/data/mods/public/maps/skirmishes/Gallic Fields (3).js
27

thx

temple raised a concern with this commit.Jan 13 2018, 1:56 AM
temple added a subscriber: temple.
temple added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
5109

From D1150: "Concerning allowCapture, i'm worried that changing the order of arguments may break some existing code." Indeed, it breaks formation attacks as fpre found.

this.CallMemberFunction("Attack", [target, false, allowCapture]);
this.CallMemberFunction("Attack", [this.order.data.target, false, this.order.data.allowCapture]);
This commit now has outstanding concerns.Jan 13 2018, 1:56 AM
mimo added a comment.Jan 13 2018, 10:40 AM

Thanks for the report. Fixed in rP20848

temple accepted this commit.Jan 13 2018, 3:45 PM
3141	                    this.Attack(msg.data.attacker, false);

This is for animals, and used to mean queued = false but now means allowCapture = false. Since queued = false by default and since animals can't capture at the moment this doesn't break anything, but maybe it should be changed. Anyway I'll accept the commit. (Maybe it should be pushing an attack order instead? Whatever.)

All concerns with this commit have now been addressed.Jan 13 2018, 3:45 PM
mimo added a comment.Jan 13 2018, 9:14 PM
3141	                    this.Attack(msg.data.attacker, false);

This is for animals, and used to mean queued = false but now means allowCapture = false. Since queued = false by default and since animals can't capture at the moment this doesn't break anything, but maybe it should be changed. Anyway I'll accept the commit. (Maybe it should be pushing an attack order instead? Whatever.)

Yes i noticed that one :) but as nearly all orders don't undicate the queued argument when false, that's fine as it is now consistent with them.