Fix crashers in rc plane code
authorunc0rr
Wed, 30 Apr 2014 14:17:06 +0400
changeset 10234 a3a200e35c6e
parent 10233 aef994a2ec1a
child 10235 bafca1686867
Fix crashers in rc plane code
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Tue Apr 29 10:20:45 2014 +0400
+++ b/hedgewars/uGearsHandlersMess.pas	Wed Apr 30 14:17:06 2014 +0400
@@ -3430,7 +3430,7 @@
 
     // pickup bonuses
     t := CheckGearNear(Gear, gtCase, 36, 36);
-    if t <> nil then
+    if (t <> nil) and (HHGear <> nil) then
         PickUp(HHGear, t);
 
     CheckCollision(Gear);
@@ -3464,7 +3464,8 @@
             TurnTimeLeft:= 14 * 125;
             end;
 
-        HHGear^.Message := 0;
+        if HHGear <> nil then 
+            HHGear^.Message := 0;
         ParseCommand('/taunt ' + #1, true)
         end
 end;