Opened 5 years ago

Closed 3 years ago

#5511 closed defect (fixed)

Units actually attacking an allied storehouse

Reported by: elexis Owned by: Freagarach
Priority: Should Have Milestone: Alpha 25
Component: Simulation Keywords:
Cc: Patch: Phab:D3840

Description (last modified by elexis)

In this r22484 replay at minute 23:35, bbs units attacked my storehouse that had just been captured by territory few moments ago (including health reduction), at the very top / north of the map.

So this might or might not be different from #3484.

Attachments (2)

commands.txt (718.5 KB ) - added by elexis 5 years ago.
commands.2.txt (13.9 KB ) - added by Freagarach 4 years ago.
Recent replay.

Download all attachments as: .zip

Change History (9)

by elexis, 5 years ago

Attachment: commands.txt added

comment:1 by elexis, 5 years ago

Description: modified (diff)

by Freagarach, 4 years ago

Attachment: commands.2.txt added

Recent replay.

comment:2 by Freagarach, 4 years ago

(Replay is from r23587.)

The problem is that an order to attack was given without allowing capture, thus the attacking entity will use melee, against an enemy structure. When the structure was captured by the ally it starts losing CP. In the check whether the attacking unit CanAttack the structure there is no check whether it can continue the current attack (i.e. one could pass the attack type currently used) but just whether it could, using all types possible, attack the entity. And it can, because there are enemy CP in the CP-array. Hence continueing the attack, although with melee.

Steps to reproduce:

  • Have an ally and an enemy.
  • Give the order to melee attack the building of an enemy.
  • Use wololo to capture that building using your ally, make sure it will decay.
  • Observe your unit attacking and damaging the structure of your ally.
Last edited 4 years ago by Freagarach (previous) (diff)

comment:3 by elexis, 4 years ago

Good job, reproducible with a23 too, sounds like it's there since the introduction of Capturing.

comment:4 by Freagarach, 4 years ago

Thanks :)

Probably seen here as well https://trac.wildfiregames.com/ticket/3484#comment:13.

Last edited 4 years ago by Freagarach (previous) (diff)

comment:5 by Freagarach, 3 years ago

Milestone: BacklogAlpha 25
Owner: set to Freagarach
Patch: Phab:D3840

comment:6 by Freagarach, 3 years ago

In r25242: Fix entities being able to attack allied structures in rare cases.

Caused by not checking the attack type while performing an attack.

Closes: #5511
Differential revision: D3840
References #3484

(Which was reverted in r25246.)

comment:7 by Freagarach, 3 years ago

Resolution: fixed
Status: newclosed

In 25264:

Fix entities able to attack allied structures in rare cases (take 2).

Caused by not checking the attack type whilst performing an attack.

Fixes: #5511
Differential revision: D3845
Refs. #3484

Note: See TracTickets for help on using tickets.