hedgewars/uTeams.pas
changeset 2785 de6406cd6b25
parent 2784 1a2e3c7c6a46
child 2796 7f86e7ad378b
--- a/hedgewars/uTeams.pas	Tue Feb 09 20:47:22 2010 +0000
+++ b/hedgewars/uTeams.pas	Tue Feb 09 21:51:52 2010 +0000
@@ -360,9 +360,13 @@
           Hedgehogs[0].Hat:= 'crown';
           h:= Hedgehogs[0].Gear^.Health;
           Hedgehogs[0].Gear^.Health:= hwRound(int2hwFloat(th)*_0_375);
-          dec(th, h);
-          inc(th, Hedgehogs[0].Gear^.Health);
-          if th > MaxTeamHealth then MaxTeamHealth:= th
+          if Hedgehogs[0].Gear^.Health > h then
+              begin
+              dec(th, h);
+              inc(th, Hedgehogs[0].Gear^.Health);
+              if th > MaxTeamHealth then MaxTeamHealth:= th
+              end
+          else Hedgehogs[0].Gear^.Health:= h
           end;
       end;