When an API function takes a callback, the call to that callback should be postponed until the current scenario step is finished, and only then should it be executed. This helps find the following bugs:
local function commandHandler(a_Player, a_Split)
a_Player:GetWorld():QueueTask(
function()
a_Player:SendMessage("BUG!")
-- a_Player may be invalid here
end
)
end
When an API function takes a callback, the call to that callback should be postponed until the current scenario step is finished, and only then should it be executed. This helps find the following bugs: