#3284 closed defect (fixed)
[PATCH] Stand ground units don't attack
Reported by: | Karamel | Owned by: | mimo |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 19 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
On stand ground stance, units try to use Capture to hold position and will attack only when attacked.
This patch prevent GetBestAttack to pick Capture (the first declared).
Attachments (3)
Change History (13)
by , 9 years ago
Attachment: | attack_patch.diff added |
---|
comment:1 by , 9 years ago
Keywords: | review added |
---|---|
Milestone: | Backlog → Alpha 19 |
Summary: | [Patch] Stand ground units don't attack → [PATCH] Stand ground units don't attack |
comment:2 by , 9 years ago
You can replace this.GetAttackTypes().pop();
to types.pop();
. And what's with line breaks?
comment:3 by , 9 years ago
Keywords: | review removed |
---|
Should be solved by querying with the biggest range, or best attack against a target instead of hard-coding more things.
comment:4 by , 9 years ago
There's a separate function to determine the best attack against a target. The overall best attack is hard to determine.
IMO, this function should be deleted, and the code that uses it should instead consider what might be the best attack.
comment:5 by , 9 years ago
Keywords: | review added |
---|
GetBestAttack was only used to check range in standing ground and as a workaround for some formation versus formation while defending or standing ground.
I replaced it by GetFullAttackRange to get the full action range. The formation part is more complex and need a lot of more work in formation orders to be fixed (and it wasn't more elegant). It will be subject to more tickets and patches.
by , 9 years ago
Attachment: | 0001-GetBestAttack-replacement-stand-ground-response.patch added |
---|
Attack patch with code style review
comment:9 by , 9 years ago
Milestone: | Alpha 20 → Alpha 19 |
---|
comment:10 by , 9 years ago
Keywords: | review removed |
---|
As all turrets are in standground, this bug was affecting the garrison on walls, so I've pushed it back to a19.
karamel, thanks for the patch. I nonetheless slightly modified it (main change is using "for of" instead of "for in" for arrays when you don't need the array indices).
Static attack preference for best attack