Special case small radius gears to try and prevent repeated collisions.
authornemo
Sat, 20 Aug 2011 14:26:29 -0400
changeset 5606 75916086afa3
parent 5604 d81727c49617
child 5608 1e5d925dde9d
Special case small radius gears to try and prevent repeated collisions.
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Sat Aug 20 14:00:51 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Sat Aug 20 14:26:29 2011 -0400
@@ -358,8 +358,9 @@
     if (Gear^.nImpactSounds > 0) and 
        ((Gear^.Damage <> 0) or 
           ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) and
-       ((Gear^.dX.QWordValue > _0_1.QWordValue) or 
-          (Gear^.dY.QWordValue > _0_1.QWordValue)) then
+       (((Gear^.Radius < 3) and (Gear^.dY < -_0_1)) or
+        ((Gear^.Radius >= 3) and ((Gear^.dX.QWordValue > _0_1.QWordValue) or 
+          (Gear^.dY.QWordValue > _0_1.QWordValue)))) then
         PlaySound(TSound(ord(Gear^.ImpactSound) + LongInt(GetRandom(Gear^.nImpactSounds))), true);
 end;