Ok. *these* should be safe with just this one extra check...
authornemo
Fri, 20 Jul 2012 21:15:38 -0400
changeset 7412 9e5aa3c8dc62
parent 7410 dc869f3187ca
child 7414 a9f18c66ce34
Ok. *these* should be safe with just this one extra check...
hedgewars/uCommandHandlers.pas
hedgewars/uCommands.pas
hedgewars/uGears.pas
--- a/hedgewars/uCommandHandlers.pas	Fri Jul 20 19:56:58 2012 -0400
+++ b/hedgewars/uCommandHandlers.pas	Fri Jul 20 21:15:38 2012 -0400
@@ -786,23 +786,23 @@
 procedure initModule;
 begin
 //////// Begin top sorted by freq analysis not including chatmsg
-    RegisterVariable('+right'  , @chRight_p      , false, false);
-    RegisterVariable('-right'  , @chRight_m      , false, false);
-    RegisterVariable('+up'     , @chUp_p         , false, false);
-    RegisterVariable('-up'     , @chUp_m         , false, false);
-    RegisterVariable('+left'   , @chLeft_p       , false, false);
-    RegisterVariable('-left'   , @chLeft_m       , false, false);
-    RegisterVariable('+attack' , @chAttack_p     , false, false);
-    RegisterVariable('+down'   , @chDown_p       , false, false);
-    RegisterVariable('-down'   , @chDown_m       , false, false);
-    RegisterVariable('hjump'   , @chHJump        , false, false);
-    RegisterVariable('ljump'   , @chLJump        , false, false);
-    RegisterVariable('nextturn', @chNextTurn     , false, false);
-    RegisterVariable('-attack' , @chAttack_m     , false, false);
-    RegisterVariable('slot'    , @chSlot         , false, false);
-    RegisterVariable('setweap' , @chSetWeapon    , false, false);
+    RegisterVariable('+right'  , @chRight_p      , false, true);
+    RegisterVariable('-right'  , @chRight_m      , false, true);
+    RegisterVariable('+up'     , @chUp_p         , false, true);
+    RegisterVariable('-up'     , @chUp_m         , false, true);
+    RegisterVariable('+left'   , @chLeft_p       , false, true);
+    RegisterVariable('-left'   , @chLeft_m       , false, true);
+    RegisterVariable('+attack' , @chAttack_p     , false);
+    RegisterVariable('+down'   , @chDown_p       , false, true);
+    RegisterVariable('-down'   , @chDown_m       , false, true);
+    RegisterVariable('hjump'   , @chHJump        , false, true);
+    RegisterVariable('ljump'   , @chLJump        , false, true);
+    RegisterVariable('nextturn', @chNextTurn     , false);
+    RegisterVariable('-attack' , @chAttack_m     , false);
+    RegisterVariable('slot'    , @chSlot         , false);
+    RegisterVariable('setweap' , @chSetWeapon    , false, true);
 //////// End top by freq analysis
-    RegisterVariable('gencmd'  , @chGenCmd       , false, false);
+    RegisterVariable('gencmd'  , @chGenCmd       , false);
     RegisterVariable('flag'    , @chFlag         , false);
     RegisterVariable('script'  , @chScript       , false);
     RegisterVariable('proto'   , @chCheckProto   , true );
@@ -846,10 +846,10 @@
     RegisterVariable('zoomout' , @chZoomOut      , true );
     RegisterVariable('zoomreset',@chZoomReset    , true );
     RegisterVariable('ammomenu', @chAmmoMenu     , true);
-    RegisterVariable('+precise', @chPrecise_p    , false);
-    RegisterVariable('-precise', @chPrecise_m    , false);
+    RegisterVariable('+precise', @chPrecise_p    , false, true);
+    RegisterVariable('-precise', @chPrecise_m    , false, true);
     RegisterVariable('switch'  , @chSwitch       , false);
-    RegisterVariable('timer'   , @chTimer        , false);
+    RegisterVariable('timer'   , @chTimer        , false, true);
     RegisterVariable('taunt'   , @chTaunt        , false);
     RegisterVariable('put'     , @chPut          , false);
     RegisterVariable('+volup'  , @chVol_p        , true );
--- a/hedgewars/uCommands.pas	Fri Jul 20 19:56:58 2012 -0400
+++ b/hedgewars/uCommands.pas	Fri Jul 20 21:15:38 2012 -0400
@@ -93,9 +93,12 @@
     begin
     if t^.Name = CmdStr then
         begin
-        if t^.Rand then CheckSum:= CheckSum xor LongWord(SDLNet_Read32(@CmdStr)) xor LongWord(s[0]) xor GameTicks;
         if TrustedSource or t^.Trusted then
+            begin
+            if t^.Rand and not CheckNoTeamOrHH then 
+                CheckSum:= CheckSum xor LongWord(SDLNet_Read32(@CmdStr)) xor LongWord(s[0]) xor GameTicks;
             t^.Handler(s);
+            end;
         exit
         end
     else
--- a/hedgewars/uGears.pas	Fri Jul 20 19:56:58 2012 -0400
+++ b/hedgewars/uGears.pas	Fri Jul 20 21:15:38 2012 -0400
@@ -461,7 +461,7 @@
     if (not CurrentTeam^.ExtDriven) or CurrentTeam^.hasGone then
         inc(hiTicks) // we do not recieve a message for this
     end;
-//AddRandomness(CheckSum);
+AddRandomness(CheckSum);
 ScriptCall('onGameTick');
 if GameTicks mod 20 = 0 then ScriptCall('onGameTick20');
 inc(GameTicks)