aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-10-17 21:06:48 +0100
committerGitHub <noreply@github.com>2022-10-17 22:06:48 +0200
commit118f9414326b0af067ee2a925d052c3ee17e4bef (patch)
treea8cf1d3a5621b617e23b15d0c3d9c6ecf9b5c8f7 /Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut
parent1804b784eee053a1031a9f095955de88b0179e1e (diff)
downloadNorthstarMods-118f9414326b0af067ee2a925d052c3ee17e4bef.tar.gz
NorthstarMods-118f9414326b0af067ee2a925d052c3ee17e4bef.zip
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut6
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()