aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut
diff options
context:
space:
mode:
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 02be47a4..1092bf2d 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()