portal-link-bugfix: make sure deleted portals don't reset links other than those to themselves
authorsheepluva
Mon, 17 May 2010 09:45:46 +0000
changeset 3472 b1832a3761e6
parent 3471 e1f1ab5dfd8f
child 3473 f80431269806
portal-link-bugfix: make sure deleted portals don't reset links other than those to themselves
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Mon May 17 06:26:06 2010 +0000
+++ b/hedgewars/uGears.pas	Mon May 17 09:45:46 2010 +0000
@@ -509,7 +509,8 @@
 if (Gear^.Kind = gtPortal) then
     begin
     if (Gear^.IntersectGear <> nil) then
-        Gear^.IntersectGear^.IntersectGear:= nil;
+        if (Gear^.IntersectGear^.IntersectGear = Gear) then
+            Gear^.IntersectGear^.IntersectGear:= nil;
     end
 else if Gear^.Kind = gtHedgehog then
     if (CurAmmoGear <> nil) and (CurrentHedgehog^.Gear = Gear) then