From 5dd9242efcee7ef3ce700ec2dbeea3a0ac2c91d2 Mon Sep 17 00:00:00 2001 From: Casper Talvio Date: Mon, 11 Dec 2023 01:03:30 +0200 Subject: [PATCH] Add validitycheck to SaveStatsPeriodically_Threaded --- Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut index bd64e4caa..80a01766b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut @@ -1035,6 +1035,8 @@ void function SaveStatsPeriodically_Threaded() while( true ) { foreach( entity player in GetPlayerArray() ) + if ( !IsValid( player ) ) + continue Stats_SaveAllStats( player ) wait 5 }