Index: ps/trunk/binaries/data/mods/public/simulation/components/Auras.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/Auras.js +++ ps/trunk/binaries/data/mods/public/simulation/components/Auras.js @@ -86,7 +86,7 @@ var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); if (!cmpPlayer) cmpPlayer = QueryOwnerInterface(this.entity); - if (!cmpPlayer) + if (!cmpPlayer || cmpPlayer.GetState() == "defeated") return; var numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); @@ -426,4 +426,9 @@ } }; +Auras.prototype.OnPlayerDefeated = function(msg) +{ + this.Clean(); +}; + Engine.RegisterComponentType(IID_Auras, "Auras", Auras); Index: ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Auras.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Auras.js +++ ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Auras.js @@ -8,6 +8,7 @@ let playerID = [0, 1, 2]; let playerEnt = [10, 11, 12]; +let playerState = "active"; let giverEnt = 20; let targetEnt = 30; let auraRange = 40; @@ -51,7 +52,8 @@ AddMock(playerEnt[1], IID_Player, { "IsAlly": id => id == 1, "IsEnemy": id => id != 1, - "GetPlayerID": () => playerID[1] + "GetPlayerID": () => playerID[1], + "GetState": () => playerState }); AddMock(targetEnt, IID_Identity, { @@ -123,3 +125,8 @@ cmpAuras.RemoveFormationBonus([targetEnt]); TS_ASSERT_EQUALS(ApplyValueModificationsToEntity("Component/Value", 5, targetEnt), 5); }); + +playerState = "defeated"; +testAuras("global", (name, cmpAuras) => { + TS_ASSERT_EQUALS(ApplyValueModificationsToTemplate("Component/Value", 5, playerID[1], template), 5); +});