diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-10-17 21:06:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 22:06:48 +0200 |
commit | 118f9414326b0af067ee2a925d052c3ee17e4bef (patch) | |
tree | a8cf1d3a5621b617e23b15d0c3d9c6ecf9b5c8f7 /Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut | |
parent | 1804b784eee053a1031a9f095955de88b0179e1e (diff) | |
download | NorthstarMods-118f9414326b0af067ee2a925d052c3ee17e4bef.tar.gz NorthstarMods-118f9414326b0af067ee2a925d052c3ee17e4bef.zip |
Use refactor's updated miscserverscript defs (#519)v1.10.5-rc2v1.10.5-rc1v1.10.5v1.10.4-rc1v1.10.4v1.10.3-rc1v1.10.3v1.10.2-rc1v1.10.2v1.10.1-rc1v1.10.1v1.10.0-rc5v1.10.0-rc4v1.10.0-rc3v1.10.0-rc2v1.10.0-rc1v1.10.0
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut index 02be47a43..1092bf2d8 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut @@ -9,7 +9,7 @@ void function MenuCallbacks_Init() bool function ClientCommandCallback_LeaveMatch( entity player, array<string> args ) { // note: this is imperfect if we have multiple people of the same uid on a server, but that's only a thing in testing - if ( NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) ) + if ( NSIsPlayerLocalPlayer( player ) ) { if ( GetConVarBool( "ns_should_return_to_lobby" ) && GetMapName() != "mp_lobby" ) { @@ -41,9 +41,11 @@ void function WritePersistenceAndLeaveForLocalPlayerOnly( entity player ) void function WritePersistenceAndLeave( entity player ) { + player.EndSignal( "OnDestroy" ) + // write player persistence before we leave, since leaving player might load local lobby before server writes persistence, so they won't get newest // not super essential, but a nice qol thing - NSEarlyWritePlayerIndexPersistenceForLeave( player.GetPlayerIndex() ) + NSEarlyWritePlayerPersistenceForLeave( player ) while ( NSIsWritingPlayerPersistence() ) WaitFrame() |