fix segfault on destroyed portal
authorsheepluva
Tue, 04 May 2010 02:46:23 +0000
changeset 3416 310fda7c1dc5
parent 3415 1ca22b3493e9
child 3417 27ff4a6375dd
fix segfault on destroyed portal
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Tue May 04 02:34:23 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Tue May 04 02:46:23 2010 +0000
@@ -3045,7 +3045,12 @@
 var iterator: PGear;
     s: hwFloat;
 begin
-    if (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) = 0 then DeleteGear(Gear);
+    if (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) = 0 then
+        begin
+        DeleteGear(Gear);
+        EXIT;
+        end;
+        
     if Gear^.IntersectGear <> nil then
     //if (Gear^.IntersectGear <> nil) then
         begin