Don't play duck drop sound when duck spawns in water
authorWuzzy <almikes@aol.com>
Fri, 13 May 2016 00:17:05 +0200
changeset 12204 0a7d7256d3d8
parent 12203 668ee6e388bd
child 12205 d52af905437b
Don't play duck drop sound when duck spawns in water
hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Fri May 13 00:08:09 2016 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Fri May 13 00:17:05 2016 +0200
@@ -326,7 +326,12 @@
                                  end;
                      amDynamite: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000);
                          amDuck: begin
-                                 PlaySound(sndDuckDrop);
+                                 // Does duck spawn inside water?
+                                 if (LeftX > hwRound(Gear^.X) - Gear^.Karma) or (RightX < hwRound(Gear^.X) + Gear^.Karma) or (cWaterLine < hwRound(Gear^.Y) + Gear^.Karma) then
+                                     PlaySound(sndDroplet2)
+                                 else
+                                     // Duck spawned in air, normal drop sound
+                                     PlaySound(sndDuckDrop);
                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtDuck, 0, _0, _0, 0);
                                  if not ((not dX.isNegative) xor ((State and gstHHHJump) <> 0)) then
                                      newGear^.Tag:= -1