FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
291 stars 98 forks source link

Fix ZoneCaptureCoalition on player ejects / gets killed in zone #2151

Closed w3z315 closed 4 months ago

w3z315 commented 4 months ago

ZoneCaptureCoalition.lua:879 calls GetScannedSetUnit and will stop the scheduler if the error message for STATICs is raised. We already have a check if it is present so we can add this explicitly here. Without the check the capture zone will not work anymore.

See this log entry for what happens when it isn't set:


2024-07-20 21:58:11.772 INFO    SCRIPTING (Main): stack traceback:
    [string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Core/ScheduleDispatcher.lua"]:180: in function <[string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Core/ScheduleDispatcher.lua"]:177>
    [C]: in function 'error'
    [string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Wrapper/Static.lua"]:117: in function 'FindByName'
    [string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Core/Zone.lua"]:1207: in function 'GetScannedSetUnit'
    [string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Functional/ZoneCaptureCoalition.lua"]:879: in function <[string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Functional/ZoneCaptureCoalition.lua"]:843>
    (tail call): ?
    [C]: in function 'xpcall'
    [string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Core/ScheduleDispatcher.lua"]:233: in function <[string "C:\Users\w3z315\Saved Games\DCS\Missions\Moose\Moose Development/Moose/Core/ScheduleDispatcher.lua"]:169>```