mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Update auras of entities of other players that affected the defeated player after 2651caa885 removed this case handling unintentionally.
Also avoids some unneded player entity aura cleans. Differential Revision: https://code.wildfiregames.com/D1453 Reported and comments by: fatherbushido Reviewed By: temple refs #5099 This was SVN commit r21779.
This commit is contained in:
parent
86fcf0de8c
commit
ec8d95abe1
1 changed files with 5 additions and 5 deletions
|
|
@ -480,14 +480,14 @@ Auras.prototype.OnGlobalResearchFinished = function(msg)
|
|||
};
|
||||
|
||||
/**
|
||||
* Only update playerauras, since units and structures are updated OnOwnershipChanged.
|
||||
* Update auras of the player entity and entities affecting player entities that didn't change ownership.
|
||||
*/
|
||||
Auras.prototype.OnGlobalPlayerDefeated = function(msg)
|
||||
{
|
||||
if (!Engine.QueryInterface(this.entity, IID_Player))
|
||||
return;
|
||||
|
||||
this.Clean();
|
||||
let cmpPlayer = Engine.QueryInterface(this.entity, IID_Player);
|
||||
if (cmpPlayer && cmpPlayer.GetPlayerID() == msg.playerId ||
|
||||
this.GetAuraNames().some(name => this.GetAffectedPlayers(name).indexOf(msg.playerId) != -1))
|
||||
this.Clean();
|
||||
};
|
||||
|
||||
Engine.RegisterComponentType(IID_Auras, "Auras", Auras);
|
||||
|
|
|
|||
Loading…
Reference in a new issue