From 20ea96e784e474fee04d82e07329f86885b42c40 Mon Sep 17 00:00:00 2001 From: elexis Date: Fri, 21 Oct 2016 11:34:20 +0000 Subject: [PATCH] Reset the rallypoint when capturing that building or unit, since the rallypoint command is only meaningful to the player that issued it. Reviewed by fatherbushido. This was SVN commit r18848. --- .../mods/public/simulation/components/RallyPoint.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/binaries/data/mods/public/simulation/components/RallyPoint.js b/binaries/data/mods/public/simulation/components/RallyPoint.js index be669e15aa..c42e3e568e 100644 --- a/binaries/data/mods/public/simulation/components/RallyPoint.js +++ b/binaries/data/mods/public/simulation/components/RallyPoint.js @@ -103,6 +103,16 @@ RallyPoint.prototype.OnGlobalEntityRenamed = function(msg) } }; +RallyPoint.prototype.OnOwnershipChanged = function(msg) +{ + // No need to reset when constructing or destructing the entity + // Don't reset upon defeat to improve performance + if (msg.from == -1 || msg.to < 1) + return; + + this.Reset(); +}; + /** * Returns true if the target exists and has non-zero hitpoints. */