hedgewars/PascalExports.pas
changeset 3989 adffb668f06e
parent 3981 928e2040d34f
child 4150 050163c35c83
--- a/hedgewars/PascalExports.pas	Thu Oct 21 15:40:43 2010 -0400
+++ b/hedgewars/PascalExports.pas	Thu Oct 21 23:11:49 2010 +0200
@@ -297,8 +297,12 @@
 var a : PHHAmmo;
     slot, index: LongInt;
 begin
-    if (CurrentTeam^.ExtDriven) or (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
+    if (CurrentTeam = nil) or
+       (CurrentHedgehog = nil) or
+       (CurrentTeam^.ExtDriven) or
+       (CurrentTeam^.Hedgehogs[0].BotLevel <> 0) then
         exit(-1);
+
     a:= CurrentHedgehog^.Ammo;
     for slot:= 0 to cMaxSlotIndex do
         for index:= 0 to cMaxSlotAmmoIndex do
@@ -314,7 +318,7 @@
         skipTurns[ord(a)-1]:= byte(Ammoz[a].SkipTurns);
 end;
 
-function HW_getTurnsForCurrentTeam:LongInt; cdecl; export;
+function HW_getTurnsForCurrentTeam: LongInt; cdecl; export;
 begin
     exit(CurrentTeam^.Clan^.TurnNumber);
 end;