IsHogLocal: If there's a mission team, only count members in the clan of that team
authorWuzzy <Wuzzy2@mail.ru>
Sun, 26 May 2019 14:27:55 +0200
changeset 15058 e3b3fa42a93b
parent 15057 1a754860b0e5
child 15059 c59bdec25012
IsHogLocal: If there's a mission team, only count members in the clan of that team This attends to a hack in some missions which use fake human teams in the enemy clans for animation purposes.
ChangeLog.txt
hedgewars/uTeams.pas
--- a/ChangeLog.txt	Sun May 26 14:16:35 2019 +0200
+++ b/ChangeLog.txt	Sun May 26 14:27:55 2019 +0200
@@ -177,6 +177,7 @@
  * Fix DismissTeam not clearing team properly
  * SimpleMission: Fix Lua error spam when a custom goal fails
  * gstWinner state is preserved after the game ended
+ * If there's a mission team IsHogLocal now only returns true for hogs in the same clan as the mission team
 
 ====================== 0.9.25 ======================
 HIGHLIGHTS:
--- a/hedgewars/uTeams.pas	Sun May 26 14:16:35 2019 +0200
+++ b/hedgewars/uTeams.pas	Sun May 26 14:27:55 2019 +0200
@@ -563,7 +563,8 @@
         begin
         if (not ExtDriven) and (Hedgehogs[0].BotLevel = 0) then
             begin
-            Clan^.LocalOrAlly:= true;
+            if (MissionTeam = nil) or (MissionTeam^.TeamName = TeamName) then
+                Clan^.LocalOrAlly:= true;
             LocalTeam:= t;
             LocalAmmo:= Hedgehogs[0].AmmoStore
             end;