hedgewars/uAI.pas
changeset 4372 3836973380b9
parent 4368 b89235e401e5
child 4373 fe0e3903bb9e
--- a/hedgewars/uAI.pas	Wed Nov 17 22:26:34 2010 +0300
+++ b/hedgewars/uAI.pas	Wed Nov 17 22:09:07 2010 -0500
@@ -66,7 +66,7 @@
     Score, i: LongInt;
     a, aa: TAmmoType;
 begin
-BotLevel:= PHedgehog(Me^.Hedgehog)^.BotLevel;
+BotLevel:= Me^.Hedgehog^.BotLevel;
 
 for i:= 0 to Pred(Targets.Count) do
     if (Targets.ar[i].Score >= 0) and (not StopThinking) then
@@ -195,7 +195,7 @@
 Actions.Pos:= 0;
 Actions.Score:= 0;
 Stack.Count:= 0;
-BotLevel:= PHedgehog(Me^.Hedgehog)^.BotLevel;
+BotLevel:= Me^.Hedgehog^.BotLevel;
 
 tmp:= random(2) + 1;
 Push(0, Actions, Me^, tmp);
@@ -322,7 +322,7 @@
 
 FillBonuses((Me^.State and gstAttacked) <> 0);
 for a:= Low(TAmmoType) to High(TAmmoType) do
-    CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(PHedgehog(Me^.Hedgehog)^, a);
+    CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(Me^.Hedgehog^, a);
 {$IFDEF DEBUGFILE}AddFileLog('Enter Think Thread');{$ENDIF}
 BeginThread(@Think, Me, ThinkThread)
 end;