If u play Piano, you can now hear the notes if sound effects OR music is enabled
authorWuzzy <Wuzzy2@mail.ru>
Fri, 26 Oct 2018 04:54:29 +0200
changeset 13983 3ae88a9f9dca
parent 13982 e340ce5500d7
child 13984 6938cab93016
If u play Piano, you can now hear the notes if sound effects OR music is enabled Previously, they always required sound effects to be on
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
--- a/ChangeLog.txt	Fri Oct 26 04:30:47 2018 +0200
+++ b/ChangeLog.txt	Fri Oct 26 04:54:29 2018 +0200
@@ -58,7 +58,7 @@
  * Prevent voices from being spoken directly before a victory voice
  * Fix damage not being displayed if hog drowns in water with 100% opacity (like in Compost theme)
  * Fix retreat timer appearing after using baseball bat or whip and immediately taking damage
- * Fix Ride of the Valkyries not playing if music is enabled and sounds are disabled
+ * Fix musical effects of RC plane and piano not playing if music is enabled but sounds effects are disabled
 
 Frontend:
  + Add help button in main menu (link to Hedgewars Wiki)
--- a/hedgewars/uGearsHandlersMess.pas	Fri Oct 26 04:30:47 2018 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Oct 26 04:54:29 2018 +0200
@@ -5188,19 +5188,21 @@
     odY: hwFloat;
 begin
     AllInactive := false;
+    // Play piano notes with slot keys
     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and
         ((CurrentHedgehog^.Gear^.Message and gmSlot) <> 0) then
             begin
+                // Piano notes are played if sound OR music (or both) is enabled
                 case CurrentHedgehog^.Gear^.MsgParam of
-                0: PlaySound(sndPiano0);
-                1: PlaySound(sndPiano1);
-                2: PlaySound(sndPiano2);
-                3: PlaySound(sndPiano3);
-                4: PlaySound(sndPiano4);
-                5: PlaySound(sndPiano5);
-                6: PlaySound(sndPiano6);
-                7: PlaySound(sndPiano7);
-                else PlaySound(sndPiano8);
+                0: PlaySound(sndPiano0, false, false, true);
+                1: PlaySound(sndPiano1, false, false, true);
+                2: PlaySound(sndPiano2, false, false, true);
+                3: PlaySound(sndPiano3, false, false, true);
+                4: PlaySound(sndPiano4, false, false, true);
+                5: PlaySound(sndPiano5, false, false, true);
+                6: PlaySound(sndPiano6, false, false, true);
+                7: PlaySound(sndPiano7, false, false, true);
+                8: PlaySound(sndPiano8, false, false, true);
             end;
         AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
         CurrentHedgehog^.Gear^.MsgParam := 0;