mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
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 This was SVN commit r25242.
This commit is contained in:
parent
b7db124cb5
commit
189d00d811
1 changed files with 2 additions and 2 deletions
|
|
@ -452,7 +452,7 @@ Attack.prototype.StartAttacking = function(target, type, callerIID)
|
|||
if (this.target)
|
||||
this.StopAttacking();
|
||||
|
||||
if (!this.CanAttack(target))
|
||||
if (!this.CanAttack(target, [type]))
|
||||
return false;
|
||||
|
||||
let timings = this.GetTimers(type);
|
||||
|
|
@ -522,7 +522,7 @@ Attack.prototype.StopAttacking = function(reason)
|
|||
*/
|
||||
Attack.prototype.Attack = function(type, lateness)
|
||||
{
|
||||
if (!this.CanAttack(this.target))
|
||||
if (!this.CanAttack(this.target, [type]))
|
||||
{
|
||||
this.StopAttacking("TargetInvalidated");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue