# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1568556251 -7200
# Node ID 0e3bf53dfe4710f42f6a0779bd9adf7620dbac5d
# Parent  e347c3508f9573c63155d1c753c7935a72626076
Racer, TechRacer: Mask taunts like Stupid when track was completed successfully

diff -r e347c3508f95 -r 0e3bf53dfe47 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sun Sep 15 15:54:43 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Sun Sep 15 16:04:11 2019 +0200
@@ -774,6 +774,10 @@
         AddAmmo(CurrentHedgehog, amAirAttack, 0)
         gTimer = 0
 
+        SetSoundMask(sndStupid, false)
+        SetSoundMask(sndBugger, false)
+        SetSoundMask(sndDrat, false)
+
         -- Remember ammo delays for later
         if ammoDelays == nil then
                 ammoDelays = {}
@@ -953,7 +957,11 @@
 
                                 AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)),GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
 
+				-- Track completed, all waypoints touched
                                 if (CheckWaypoints() == true) then
+                                        SetSoundMask(sndStupid, true)
+                                        SetSoundMask(sndBugger, true)
+                                        SetSoundMask(sndDrat, true)
                                         AdjustScores()
                                         SetEffect(CurrentHedgehog, heInvulnerable, 1)
                                         DisableTumbler()
diff -r e347c3508f95 -r 0e3bf53dfe47 share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sun Sep 15 15:54:43 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Sun Sep 15 16:04:11 2019 +0200
@@ -949,6 +949,10 @@
 
 function onNewTurn()
 
+	SetSoundMask(sndStupid, false)
+	SetSoundMask(sndDrat, false)
+	SetSoundMask(sndBugger, false)
+
 	CheckForNewRound()
 	TryRepositionHogs()
 
@@ -1089,7 +1093,11 @@
 
 				AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)), GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
 
+				-- Track completed, all waypoints touched!
 				if (CheckWaypoints() == true) then
+					SetSoundMask(sndStupid, true)
+					SetSoundMask(sndDrat, true)
+					SetSoundMask(sndBugger, true)
 					AdjustScores()
 					DisableTumbler()
 				end