Merge pull request #8 from spencershepard/bugfix/changeGameState-error

Update RotorOps.lua
This commit is contained in:
spencershepard 2022-01-10 20:00:21 -08:00 committed by GitHub
commit f72f039e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
RotorOps = {}
RotorOps.version = "1.0.10"
RotorOps.version = "1.0.11"
--RotorOps settings that are safe to change dynamically (ideally from the mission editor in DO SCRIPT for ease of use)
RotorOps.voice_overs = true
@ -569,7 +569,7 @@ function RotorOps.assessUnitsInZone(var)
--is the game finished?
if all_zones_clear then
changeGameState(RotorOps.game_states.won)
RotorOps.changeGameState(RotorOps.game_states.won)
gameMsg(gameMsgs.success)
return --we won't reset our timer to fire this function again
end
@ -655,7 +655,7 @@ end
local function changeGameState(new_state)
function RotorOps.changeGameState(new_state)
RotorOps.game_state = new_state
trigger.action.setUserFlag(RotorOps.game_state_flag, new_state)
end
@ -678,7 +678,7 @@ function RotorOps.setActiveZone(new_index)
ctld.activatePickupZone(RotorOps.zones[old_index].name)
end
ctld.deactivatePickupZone(RotorOps.zones[new_index].name)
changeGameState(new_index)
RotorOps.changeGameState(new_index)
if new_index < old_index then gameMsg(gameMsgs.fallback, new_index) end
if new_index > old_index then gameMsg(gameMsgs.get_troops_to_zone, new_index) end
@ -771,7 +771,7 @@ function RotorOps.setupConflict(_game_state_flag)
RotorOps.setupCTLD()
--RotorOps.setupRadioMenu()
RotorOps.game_state_flag = _game_state_flag
changeGameState(RotorOps.game_states.not_started)
RotorOps.changeGameState(RotorOps.game_states.not_started)
trigger.action.outText("ALL TROOPS GET TO TRANSPORT AND PREPARE FOR DEPLOYMENT!" , 10, false)
end