cWindSpeed recalculation assumed GetRandom returns a value between 0.0-1.0 while in fact is in the 0.0-0.5 range; Halve cMaxWindSpeed to compensate.
authorpalewolf
Sat, 17 Apr 2010 23:03:52 +0000
changeset 3355 dc9e61e67484
parent 3354 cb5d13ff4aae
child 3356 3ae3fccb439e
cWindSpeed recalculation assumed GetRandom returns a value between 0.0-1.0 while in fact is in the 0.0-0.5 range; Halve cMaxWindSpeed to compensate.
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uGears.pas
hedgewars/uMisc.pas
hedgewars/uTeams.pas
--- a/hedgewars/GSHandlers.inc	Sat Apr 17 13:04:36 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sat Apr 17 23:03:52 2010 +0000
@@ -1802,8 +1802,8 @@
 if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
     HHGear^.X:= HHGear^.X + cWindSpeed * 200;
 
-if (Gear^.Message and gm_Left) <> 0 then HHGear^.X:= HHGear^.X - cMaxWindSpeed * 40
-else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X:= HHGear^.X + cMaxWindSpeed * 40;
+if (Gear^.Message and gm_Left) <> 0 then HHGear^.X:= HHGear^.X - cMaxWindSpeed * 80
+else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X:= HHGear^.X + cMaxWindSpeed * 80;
 if (Gear^.Message and gm_Up) <> 0 then HHGear^.Y:= HHGear^.Y - cGravity * 40
 else if (Gear^.Message and gm_Down) <> 0 then HHGear^.Y:= HHGear^.Y + cGravity * 40;
 
--- a/hedgewars/HHHandlers.inc	Sat Apr 17 13:04:36 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Apr 17 23:03:52 2010 +0000
@@ -198,7 +198,7 @@
                              end;
                       amLowGravity: begin
                                     PlaySound(sndLowGravity);
-                                    cGravity:= cMaxWindSpeed / 2
+                                    cGravity:= cMaxWindSpeed
                                     end;
                       amExtraDamage: cDamageModifier:= _1_5;
                       amInvulnerable: Invulnerable:= true;
--- a/hedgewars/uGears.pas	Sat Apr 17 13:04:36 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Apr 17 23:03:52 2010 +0000
@@ -817,7 +817,7 @@
     SpeechText:= ''; // in case it has not been consumed
 
     if (GameFlags and gfLowGravity) = 0 then
-        cGravity:= cMaxWindSpeed;
+        cGravity:= cMaxWindSpeed * 2;
 
     if (GameFlags and gfVampiric) = 0 then
         cVampiric:= false;
@@ -1842,7 +1842,7 @@
     end;
 
 if (GameFlags and gfLowGravity) <> 0 then
-    cGravity:= cMaxWindSpeed / 2;
+    cGravity:= cMaxWindSpeed;
 
 if (GameFlags and gfVampiric) <> 0 then
     cVampiric:= true;
--- a/hedgewars/uMisc.pas	Sat Apr 17 13:04:36 2010 +0000
+++ b/hedgewars/uMisc.pas	Sat Apr 17 23:03:52 2010 +0000
@@ -672,9 +672,9 @@
 {$IFDEF DEBUGFILE}{$IFNDEF IPHONEOS}var i: LongInt;{$ENDIF}{$ENDIF}
 begin
     cDrownSpeed.QWordValue  := 257698038;       // 0.06
-    cMaxWindSpeed.QWordValue:= 2147484;     // 0.0005
+    cMaxWindSpeed.QWordValue:= 1073742;     // 0.00025
     cWindSpeed.QWordValue   := 429496;      // 0.0001
-    cGravity                := cMaxWindSpeed;
+    cGravity                := cMaxWindSpeed * 2;
     cDamageModifier         := _1;
     TargetPoint             := cTargetPointRef;
     TextureList             := nil;
--- a/hedgewars/uTeams.pas	Sat Apr 17 13:04:36 2010 +0000
+++ b/hedgewars/uTeams.pas	Sat Apr 17 23:03:52 2010 +0000
@@ -261,7 +261,7 @@
 
 ResetKbd;
 
-cWindSpeed:= rndSign(GetRandom * cMaxWindSpeed);
+cWindSpeed:= rndSign(GetRandom * 2 * cMaxWindSpeed);
 g:= AddGear(0, 0, gtATSmoothWindCh, 0, _0, _0, 1);
 g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}