--- a/hedgewars/uScript.pas Wed Aug 22 10:27:26 2012 +0400
+++ b/hedgewars/uScript.pas Tue Aug 21 21:46:05 2012 -0400
@@ -980,10 +980,13 @@
if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) and (CurrentHedgehog <> nil) then
begin
prevgear := CurrentHedgehog^.Gear;
- prevgear^.Active := false;
- prevgear^.State:= prevgear^.State and (not gstHHDriven);
- prevgear^.Z := cHHZ;
- prevgear^.Message:= prevgear^.Message or gmRemoveFromList or gmAddToList;
+ if prevgear <> nil then
+ begin
+ prevgear^.Active := false;
+ prevgear^.State:= prevgear^.State and (not gstHHDriven);
+ prevgear^.Z := cHHZ;
+ prevgear^.Message:= prevgear^.Message or gmRemoveFromList or gmAddToList;
+ end;
SwitchCurrentHedgehog(gear^.Hedgehog);
CurrentTeam:= CurrentHedgehog^.Team;