hedgewars/CCHandlers.inc
changeset 3774 af0e68ca273e
parent 3680 aaf832c6fbd7
child 3776 28849f5a03c9
--- a/hedgewars/CCHandlers.inc	Thu Aug 26 14:46:30 2010 +0100
+++ b/hedgewars/CCHandlers.inc	Thu Aug 26 16:02:09 2010 +0200
@@ -289,7 +289,7 @@
 procedure chLeft_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('L');
 with CurrentHedgehog^.Gear^ do
@@ -308,7 +308,7 @@
 procedure chRight_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('R');
 with CurrentHedgehog^.Gear^ do
@@ -327,7 +327,7 @@
 procedure chUp_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('U');
 with CurrentHedgehog^.Gear^ do
@@ -346,7 +346,7 @@
 procedure chDown_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('D');
 with CurrentHedgehog^.Gear^ do
@@ -365,7 +365,7 @@
 procedure chPrecise_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('Z');
 with CurrentHedgehog^.Gear^ do
@@ -384,7 +384,7 @@
 procedure chLJump(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('j');
 with CurrentHedgehog^.Gear^ do
@@ -394,7 +394,7 @@
 procedure chHJump(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 bShowFinger:= false;
 if not CurrentTeam^.ExtDriven then SendIPC('J');
 with CurrentHedgehog^.Gear^ do
@@ -405,6 +405,12 @@
 begin
 s:= s; // avoid compiler hint
 if CheckNoTeamOrHH or isPaused then exit;
+if ReadyTimeLeft > 1 then
+    begin
+    ReadyTimeLeft:= 1; // set to 1 millisecond so we still play the sound file
+    if not CurrentTeam^.ExtDriven then SendIPC('A');
+    exit
+    end;
 bShowFinger:= false;
 with CurrentHedgehog^.Gear^ do
     begin
@@ -433,7 +439,7 @@
 procedure chSwitch(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 if not CurrentTeam^.ExtDriven then SendIPC('S');
 with CurrentHedgehog^.Gear^ do
     Message:= Message or gm_Switch
@@ -566,7 +572,7 @@
 
 procedure chNewGrave;
 begin
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 
 if not CurrentTeam^.ExtDriven then SendIPC('g');
 
@@ -575,7 +581,7 @@
 
 procedure doPut(putX, putY: LongInt; fromAI: boolean);
 begin
-if CheckNoTeamOrHH or isPaused then exit;
+if CheckNoTeamOrHH or isPaused or (ReadyTimeLeft > 0) then exit;
 if not CurrentTeam^.ExtDriven and bShowAmmoMenu then
     begin
     bSelected:= true;