Racer: Really fix delay confusion when attempting to force-disable gfKing/gfPlaceHog
authorWuzzy <Wuzzy2@mail.ru>
Mon, 16 Sep 2019 17:53:19 +0200
changeset 15432 2cde69c1c680
parent 15431 8504fee3b601
child 15433 45ac7c07543d
Racer: Really fix delay confusion when attempting to force-disable gfKing/gfPlaceHog For real this time. The previous attempt to fix this was shite.
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Mon Sep 16 17:33:49 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Mon Sep 16 17:53:19 2019 +0200
@@ -782,7 +782,12 @@
         if ammoDelays == nil then
                 ammoDelays = {}
                 for a=0, AmmoTypeMax do
-                local _, _, delay = GetAmmo(a)
+                        local _, _, delay = GetAmmo(a)
+                        -- delay >= 10000 is special value used in hog placement phase.
+                        -- This extracts the "true" delay
+                        if delay >= 10000 then
+                                delay = delay - 10000
+                        end
                         ammoDelays[a] = delay
                 end
         end