Battalion: Properly spawn crate between turns
authorWuzzy <Wuzzy2@mail.ru>
Mon, 08 Apr 2019 16:00:15 +0200
changeset 14769 dd4daa216398
parent 14768 185f07ec4d12
child 14770 0ee6b01c7f30
Battalion: Properly spawn crate between turns
share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Mon Apr 08 15:51:42 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Mon Apr 08 16:00:15 2019 +0200
@@ -923,18 +923,17 @@
   end
 end
 
-function RandomTurnEvents()
+function onCaseDrop()
   if GetRandom(100) < weaponCrateChance then
     SpawnFakeAmmoCrate(0, 0, false, false)
-    return 5000
+    PlaySound(sndReinforce, CurrentHedgehog)
   elseif GetRandom(100) < utilCrateChance then
     SpawnFakeUtilityCrate(0, 0, false, false)
-    return 5000
+    PlaySound(sndReinforce, CurrentHedgehog)
   elseif GetRandom(100) < healthCrateChance then
     SpawnFakeHealthCrate(0, 0, false, false)
-    return 5000
+    PlaySound(sndReinforce, CurrentHedgehog)
   end
-  return 0
 end
 
 --[[
@@ -1352,9 +1351,6 @@
   if mode == 'points' and GetHealth(CurHog) ~= nil then
     savePoints(CurHog)
   end
-
-  -- Run random turn events
-  RandomTurnEvents()
 end
 
 function savePoints(hog)