# HG changeset patch # User Wuzzy # Date 1568552386 -7200 # Node ID 09b63f9032f4b8f0cb55e82c9a6259839ab808c4 # Parent b186e1f4c5eddb3ab51ed7f9a2a61eb6e8fbdcdf Racer: Disable other ammos in waypoint placement phase diff -r b186e1f4c5ed -r 09b63f9032f4 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sun Sep 15 14:46:19 2019 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sun Sep 15 14:59:46 2019 +0200 @@ -62,6 +62,8 @@ local officialChallenge +local ammoDelays = {} + -------------------------- -- hog and team tracking variales -------------------------- @@ -611,6 +613,11 @@ WaterRise = 0 HealthDecrease = 0 + -- Remember ammo delays for later + for a=0, AmmoTypeMax do + local _, _, delay = GetAmmo(a) + ammoDelays[a] = delay + end end function InstructionsBuild() @@ -779,6 +786,13 @@ InstructionsRace() end + -- Restore old ammo delays + for a=0, AmmoTypeMax do + if a ~= amAirAttack and a ~= amSkip then + SetAmmoDelay(a, ammoDelays[a]) + end + end + SetAmmoTexts(amSkip, nil, nil, nil) else local infoString @@ -790,6 +804,11 @@ ShowMission(loc("Racer"), loc("Waypoint placement phase"), infoString, -amAirAttack, 4000) AddAmmo(CurrentHedgehog, amAirAttack, AMMO_INFINITE) + for a=0, AmmoTypeMax do + if a ~= amAirAttack and a ~= amSkip then + SetAmmoDelay(a, 9999) + end + end SetWeapon(amAirAttack) -- Bots skip waypoint placement if GetHogLevel(CurrentHedgehog) ~= 0 then