Fix piano spawning vgtNote if slot key without sound was pressed
authorWuzzy <Wuzzy2@mail.ru>
Sun, 19 Jul 2020 23:28:45 +0200
changeset 15753 26247a74d823
parent 15752 680dc787408c
child 15754 684838d5fb08
Fix piano spawning vgtNote if slot key without sound was pressed
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sun Jul 19 22:08:55 2020 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sun Jul 19 23:28:45 2020 +0200
@@ -5569,7 +5569,8 @@
                 7: PlaySound(sndPiano7, false, false, true);
                 8: PlaySound(sndPiano8, false, false, true);
             end;
-        AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
+        if CurrentHedgehog^.Gear^.MsgParam <= 8 then
+            AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
         CurrentHedgehog^.Gear^.MsgParam := 0;
         CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and (not gmSlot);
         end;