mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 19:43:45 +00: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user