portal-link-bugfix: make sure deleted portals don't reset links other than those to themselves
--- 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