hedgewars/uGears.pas
changeset 6380 1ff5ad1d771b
parent 6299 fa5bc796261d
child 6453 11c578d30bd3
--- a/hedgewars/uGears.pas	Mon Nov 14 17:56:44 2011 -0500
+++ b/hedgewars/uGears.pas	Mon Nov 14 18:08:36 2011 -0500
@@ -591,11 +591,8 @@
 
 DeleteCI(Gear);
 
-if Gear^.Tex <> nil then
-    begin
-    FreeTexture(Gear^.Tex);
-    Gear^.Tex:= nil
-    end;
+FreeTexture(Gear^.Tex);
+Gear^.Tex:= nil;
 
 // make sure that portals have their link removed before deletion
 if (Gear^.Kind = gtPortal) then
@@ -660,7 +657,7 @@
             with CurrentHedgehog^ do 
                 begin
                 inc(Team^.stats.AIKills);
-                if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex);
+                FreeTexture(Team^.AIKillsTex);
                 Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
                 end
         end;
@@ -803,7 +800,7 @@
         begin
         if Gear^.RenderTimer and (Gear^.Timer > 500) and ((Gear^.Timer mod 1000) = 0) then
             begin
-            if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
+            FreeTexture(Gear^.Tex);
             Gear^.Tex:= RenderStringTex(inttostr(Gear^.Timer div 1000), cWhiteColor, fntSmall);
             end;
         Gear^.doStep(Gear);
@@ -1684,7 +1681,7 @@
         with CurrentHedgehog^ do 
             begin
             inc(Team^.stats.AIKills);
-            if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex);
+            FreeTexture(Team^.AIKillsTex);
             Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
             end;
     tempTeam := gear^.Hedgehog^.Team;