This commit is contained in:
guava
2016-12-15 13:40:07 +01:00
commit ee4dd89693
95 changed files with 7368 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
-- handles the script end of the flag the 'leave game' option in the pause menu sets
CreateThread(function()
while true do
Wait(0)
-- if the flag is set
if DoesGameCodeWantToLeaveNetworkSession() then
-- if we're part of a started session; end it first (FIXME: will this break others when we're host?)
if NetworkIsSessionStarted() then
NetworkEndSession()
-- wait for the session to be ended
while NetworkEndSessionPending() do
Wait(0)
end
end
-- attempt to leave the game
NetworkLeaveGame()
-- while we're waiting to leave...
while NetworkLeaveGamePending() do
Wait(0)
end
-- reinitialize the game as a network game (TODO: call into citigame for UI/NetLibrary leaving)
--ShutdownAndLaunchNetworkGame(0) -- episode id is arg
ShutdownNetworkCit('Left');
end
end
end)