hedgewars/uGears.pas
changeset 48 0f396d0c429d
parent 47 8daf1ee0b9a3
child 49 3afe33c1cf06
--- a/hedgewars/uGears.pas	Thu Jan 12 16:33:26 2006 +0000
+++ b/hedgewars/uGears.pas	Thu Jan 12 22:07:36 2006 +0000
@@ -228,6 +228,7 @@
 end;
 
 procedure DeleteGear(Gear: PGear);
+var team: PTeam;
 begin
 if Gear.CollIndex < High(Longword) then DeleteCR(Gear);
 if Gear.Kind = gtHedgehog then
@@ -239,8 +240,9 @@
       exit
       end else
       begin
-      RecountTeamHealth(PHedgehog(Gear.Hedgehog).Team);
+      team:= PHedgehog(Gear.Hedgehog).Team;
       PHedgehog(Gear.Hedgehog).Gear:= nil;
+      RecountTeamHealth(team);
       end;
 if CurAmmoGear = Gear then
    CurAmmoGear:= nil;