fix tag toggling. I think...
authornemo
Sun, 24 Nov 2013 22:11:55 -0500
changeset 9714 54d756b6dbb1
parent 9713 cd1d63c355a6
child 9716 f1698baccaef
fix tag toggling. I think...
hedgewars/uCommandHandlers.pas
hedgewars/uInputHandler.pas
--- a/hedgewars/uCommandHandlers.pas	Sun Nov 24 14:03:33 2013 -0500
+++ b/hedgewars/uCommandHandlers.pas	Sun Nov 24 22:11:55 2013 -0500
@@ -318,8 +318,6 @@
 procedure chPrecise_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if not isExternalSource then
-    LocalMessage:= LocalMessage or gmPrecise;
 if CheckNoTeamOrHH or isPaused then
     exit;
 if not isExternalSource then
@@ -333,8 +331,6 @@
 procedure chPrecise_m(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-if not isExternalSource then
-    LocalMessage:= LocalMessage and not(gmPrecise);
 if CheckNoTeamOrHH then
     exit;
 if not isExternalSource then
--- a/hedgewars/uInputHandler.pas	Sun Nov 24 14:03:33 2013 -0500
+++ b/hedgewars/uInputHandler.pas	Sun Nov 24 22:11:55 2013 -0500
@@ -136,7 +136,9 @@
 Trusted:= (CurrentTeam <> nil)
           and (not CurrentTeam^.ExtDriven)
           and (CurrentHedgehog^.BotLevel = 0);
-
+// REVIEW OR FIXME
+// ctrl/cmd + q to close engine and frontend - this seems like a bad idea, since we let people set arbitrary binds, and don't warn them of this.
+// There's no confirmation at all
 // ctrl/cmd + q to close engine and frontend
 if(KeyDown and (code = SDLK_q)) then
     begin
@@ -167,11 +169,12 @@
 if CurrentBinds[code][0] <> #0 then
     begin
     if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) and (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) then bShowAmmoMenu:= false;
-
     if KeyDown then
         begin
         if CurrentBinds[code] = 'switch' then
-            LocalMessage:= LocalMessage or gmSwitch;
+            LocalMessage:= LocalMessage or gmSwitch
+        else if CurrentBinds[code] = '+precise' then
+            LocalMessage:= LocalMessage or gmPrecise;
             
         ParseCommand(CurrentBinds[code], Trusted);
         if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
@@ -179,6 +182,8 @@
         end
     else if (CurrentBinds[code][1] = '+') then
         begin
+        if CurrentBinds[code] = '+precise' then
+            LocalMessage:= LocalMessage and not(gmPrecise);
         s:= CurrentBinds[code];
         s[1]:= '-';
         ParseCommand(s, Trusted);