hedgewars/uTeams.pas
changeset 9720 453a1c29b7e4
parent 9685 7d925e82e572
child 9749 443d233316e5
--- a/hedgewars/uTeams.pas	Wed Nov 27 19:10:53 2013 +0100
+++ b/hedgewars/uTeams.pas	Thu Nov 28 00:41:35 2013 +0400
@@ -41,13 +41,14 @@
 procedure TeamGoneEffect(var Team: TTeam);
 procedure SwitchCurrentHedgehog(newHog: PHedgehog);
 
+var MaxTeamHealth: LongInt;
+
 implementation
 uses uLocale, uAmmos, uChat, uVariables, uUtils, uIO, uCaptions, uCommands, uDebug,
     uGearsUtils, uGearsList, uVisualGearsList, uTextures
     {$IFDEF USE_TOUCH_INTERFACE}, uTouch{$ENDIF};
 
-var MaxTeamHealth: LongInt;
-    GameOver: boolean;
+var GameOver: boolean;
     NextClan: boolean;
 
 function CheckForWin: boolean;
@@ -480,17 +481,11 @@
         else if Hedgehogs[i].GearHidden <> nil then
             inc(TeamHealth, Hedgehogs[i].GearHidden^.Health);
 
-    if not hasGone then
-        NewTeamHealthBarWidth:= TeamHealth
-        else
-        NewTeamHealthBarWidth:= 0;
-
-    if NewTeamHealthBarWidth > MaxTeamHealth then
+    if TeamHealth > MaxTeamHealth then
         begin
-        MaxTeamHealth:= NewTeamHealthBarWidth;
+        MaxTeamHealth:= TeamHealth;
         RecountAllTeamsHealth;
-        end else if NewTeamHealthBarWidth > 0 then
-            NewTeamHealthBarWidth:= (NewTeamHealthBarWidth * cTeamHealthWidth) div MaxTeamHealth
+        end
     end;
 
 RecountClanHealth(team^.Clan);