share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
changeset 14773 a9f32ff53389
parent 14772 f5dcf47dff2c
child 14811 d65e25e211d4
--- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Mon Apr 08 19:02:01 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Mon Apr 08 19:16:02 2019 +0200
@@ -853,15 +853,20 @@
 end
 
 function onCaseDrop()
+	local crates
 	if roundN == 100 then
 		allowCrate = crateGearsInGame < maxCrates
-		CheckCrateConditions()
+		crates = CheckCrateConditions()
+	end
+	if type(crates) == "table" and #crates > 0 and CurrentHedgehog then
+		PlaySound(sndReinforce, CurrentHedgehog)
 	end
 end
 
 function CheckCrateConditions()
 
 	local crateSpawn = AreCratesUnlocked()
+	local crates = {}
 
 	if crateSpawn == true and crateSpawned == false then
 		UnfreezeCrates()
@@ -872,7 +877,7 @@
 				toSpawn = maxCrates - cratesInGame
 			end
 			for i=1,toSpawn do
-				SpawnSupplyCrate(0, 0, weapons[1+GetRandom(#weapons)] )
+				table.insert(crates, SpawnSupplyCrate(0, 0, weapons[1+GetRandom(#weapons)]))
 			end
 			rPingTimer = 0
 			rAlpha = 0
@@ -882,6 +887,7 @@
 		end
 	end
 
+	return crates
 end
 
 function onGearWaterSkip(gear)