Many small improvements
authorunc0rr
Sun, 11 Feb 2007 19:38:26 +0000
changeset 434 2c6ccce17f39
parent 433 9f8f22094c0e
child 435 25820c10c849
Many small improvements
hedgewars/HHHandlers.inc
hedgewars/hwengine.dpr
hedgewars/uAI.pas
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/HHHandlers.inc	Sun Feb 11 15:33:19 2007 +0000
+++ b/hedgewars/HHHandlers.inc	Sun Feb 11 19:38:26 2007 +0000
@@ -127,6 +127,7 @@
                     RecountTeamHealth(PHedgehog(HH^.Hedgehog)^.Team)
                     end;
      end;
+FreeActionsList
 end;
 
 const StepTicks: LongWord = 0;
--- a/hedgewars/hwengine.dpr	Sun Feb 11 15:33:19 2007 +0000
+++ b/hedgewars/hwengine.dpr	Sun Feb 11 19:38:26 2007 +0000
@@ -156,7 +156,7 @@
    begin
    DoTimer(CurrTime - PrevTime);
    PrevTime:= CurrTime
-   end else {sleep(1)};
+   end else SDL_Delay(1);
 IPCCheckSock
 until isTerminated
 end;
--- a/hedgewars/uAI.pas	Sun Feb 11 15:33:19 2007 +0000
+++ b/hedgewars/uAI.pas	Sun Feb 11 19:38:26 2007 +0000
@@ -42,6 +42,10 @@
    SDL_WaitThread(ThinkThread, nil);
    ThinkThread:= nil
    end;
+
+with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
+     if Gear <> nil then Gear^.Message:= 0;
+
 BestActions.Count:= 0;
 BestActions.Pos:= 0
 end;
--- a/hedgewars/uAIAmmoTests.pas	Sun Feb 11 15:33:19 2007 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Sun Feb 11 19:38:26 2007 +0000
@@ -262,7 +262,7 @@
 Result:= 0;
 for i:= 0 to 4 do
     Result:= Result + RateShove(Me, hwRound(Me^.X) + 10 * hwSign(Targ.X - Me^.X), hwRound(Me^.Y) - 20 * i - 5, 10, 30);
-if Result <= 0 then Result:= BadTurn;
+if Result <= 0 then Result:= BadTurn else inc(Result);
 TestFirePunch:= Result
 end;