Fix attacking miraged entities.
After 738b200dda
, where the mirage should be queried in the
Start/StopAttacking functions.
Reported by: @bb
Differential revision: https://code.wildfiregames.com/D4267
Reviewed by: @bb
This was SVN commit r25914.
This commit is contained in:
parent
e56d46548b
commit
f2f412a6d2
@ -459,7 +459,7 @@ Attack.prototype.StartAttacking = function(target, type, callerIID)
|
||||
if (!this.CanAttack(target, [type]))
|
||||
return false;
|
||||
|
||||
let cmpResistance = Engine.QueryInterface(target, IID_Resistance);
|
||||
const cmpResistance = QueryMiragedInterface(target, IID_Resistance);
|
||||
if (!cmpResistance || !cmpResistance.AddAttacker(this.entity))
|
||||
return false;
|
||||
|
||||
@ -504,7 +504,7 @@ Attack.prototype.StopAttacking = function(reason)
|
||||
cmpTimer.CancelTimer(this.timer);
|
||||
delete this.timer;
|
||||
|
||||
let cmpResistance = Engine.QueryInterface(this.target, IID_Resistance);
|
||||
const cmpResistance = QueryMiragedInterface(this.target, IID_Resistance);
|
||||
if (cmpResistance)
|
||||
cmpResistance.RemoveAttacker(this.entity);
|
||||
|
||||
|
@ -190,9 +190,12 @@ ResistanceMirage.prototype.Init = function(cmpResistance)
|
||||
this.resistanceOfForm = {};
|
||||
for (const entityForm in cmpResistance.template)
|
||||
this.resistanceOfForm[entityForm] = cmpResistance.GetResistanceOfForm(entityForm);
|
||||
this.attackers = new Set();
|
||||
};
|
||||
|
||||
ResistanceMirage.prototype.IsInvulnerable = Resistance.prototype.IsInvulnerable;
|
||||
ResistanceMirage.prototype.AddAttacker = Resistance.prototype.AddAttacker;
|
||||
ResistanceMirage.prototype.RemoveAttacker = Resistance.prototype.RemoveAttacker;
|
||||
|
||||
ResistanceMirage.prototype.GetEffectiveResistanceAgainst = function(entityForm)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user