Construction Mode: Fix annoying Incoming voice and other sound issues
authorWuzzy <Wuzzy2@mail.ru>
Thu, 08 Mar 2018 19:08:21 +0100
changeset 13123 11f23afd84f2
parent 13122 d52d79f35558
child 13124 991db8fc45eb
Construction Mode: Fix annoying Incoming voice and other sound issues
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
--- a/ChangeLog.txt	Thu Mar 08 19:03:03 2018 +0100
+++ b/ChangeLog.txt	Thu Mar 08 19:08:21 2018 +0100
@@ -54,6 +54,7 @@
  + Control: Always remove TimeBox and Resurrector
  * Battalion: Some texts in the mission panel were wrong and misleading
  * Construction Mode: Remove drill strike if added by weapon scheme (it's broken)
+ * Construction Mode: No longer play Incoming voice for building stuff, fix other sound issues
  * Capture the Flag: Fix many bugs caused by playing with >2 teams
  * Capture the Flag: Properly place flag when first hog uses kamikaze or TimeBox
  * Capture the Flag: Fix flag not being dropped when carrier uses piano strike
--- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Thu Mar 08 19:03:03 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Thu Mar 08 19:08:21 2018 +0100
@@ -1081,6 +1081,9 @@
 			-- Pay the price
 			clanPower[GetHogClan(CurrentHedgehog)] = clanPower[GetHogClan(CurrentHedgehog)] - placedExpense
 			RenderClanPower()
+			if cat[cIndex] == "Girder Placement Mode" or cat[cIndex] == "Rubber Placement Mode" then
+				PlaySound(sndPlaced)
+			end
 		else
 			if IsHogLocal(CurrentHedgehog) then
 				AddCaption(loc("Invalid Placement"), colorMessageError, capgrpVolume)
@@ -1203,6 +1206,17 @@
 			updated = true
 		end
 
+		if curWep == amCMStructurePlacer or curWep == amCMCratePlacer or curWep == amCMObjectPlacer then
+			SetSoundMask(sndIncoming, true)
+		else
+			SetSoundMask(sndIncoming, false)
+		end
+		if curWep == amGirder or curWep == amRubber then
+			SetSoundMask(sndDenied, true)
+		else
+			SetSoundMask(sndDenied, false)
+		end
+
 		if updated then
 			AddCaption(loc(cat[cIndex]), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
 			showModeMessage()