only reset those keys which actually change their bindings
authorXeli
Tue, 05 Jun 2012 19:33:49 +0200
changeset 7184 211ab9e2cb15
parent 7183 95dc11d648fb
child 7185 92a045156255
only reset those keys which actually change their bindings
hedgewars/uInputHandler.pas
hedgewars/uTeams.pas
--- a/hedgewars/uInputHandler.pas	Mon Jun 04 19:43:39 2012 -0400
+++ b/hedgewars/uInputHandler.pas	Tue Jun 05 19:33:49 2012 +0200
@@ -239,11 +239,19 @@
 end;
 
 procedure SetBinds(var binds: TBinds);
+{$IFNDEF MOBILE}
+var
+    t: LongInt;
+{$ENDIF}
 begin
 {$IFDEF MOBILE}
     binds:= binds; // avoid hint
     CurrentBinds:= DefaultBinds;
 {$ELSE}
+for t:= 0 to cKeyMaxIndex do
+    if (CurrentBinds[t] <> binds[t]) and tkbd[t] then
+        ProcessKey(t, False);
+
     CurrentBinds:= binds;
 {$ENDIF}
 end;
--- a/hedgewars/uTeams.pas	Mon Jun 04 19:43:39 2012 -0400
+++ b/hedgewars/uTeams.pas	Tue Jun 05 19:33:49 2012 +0200
@@ -248,8 +248,6 @@
     FollowGear:= Gear
     end;
 
-ResetKbd;
-
 if (GameFlags and gfDisableWind) = 0 then
     begin
     cWindSpeed:= rndSign(GetRandomf * 2 * cMaxWindSpeed);