hedgewars/uKeys.pas
changeset 351 29bc9c36ad5f
parent 345 fa39c61be4de
child 371 731ad6d27bd1
--- a/hedgewars/uKeys.pas	Thu Jan 18 20:29:28 2007 +0000
+++ b/hedgewars/uKeys.pas	Sun Jan 21 19:51:02 2007 +0000
@@ -43,9 +43,11 @@
     DefaultBinds, CurrentBinds: TBinds;
 
 function KeyNameToCode(name: string): word;
+var Result: Word;
 begin
 Result:= cKeyMaxIndex;
-while (Result > 0) and (KeyNames[Result] <> name) do dec(Result)
+while (Result > 0) and (KeyNames[Result] <> name) do dec(Result);
+KeyNameToCode:= Result
 end;
 
 procedure ProcessKbd;
@@ -56,8 +58,8 @@
 begin
 KbdKeyPressed:= false;
 Trusted:= (CurrentTeam <> nil)
-          and (not CurrentTeam.ExtDriven)
-          and (CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].BotLevel = 0);
+          and (not CurrentTeam^.ExtDriven)
+          and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].BotLevel = 0);
 
 pkbd:= SDL_GetKeyState(nil);
 i:= SDL_GetMouseState(nil, nil);
@@ -75,7 +77,7 @@
              begin
              s:= CurrentBinds[i];
              s[1]:= '-';
-             ParseCommand(s)
+             ParseCommand(s, true)
              end;
           end else
           if (tkbd[i] = 0) and (pkbd^[i] <> 0) then ParseCommand(CurrentBinds[i], Trusted);