From fd02b453d3ada42d4fd1774737fca9559d971956 Mon Sep 17 00:00:00 2001 From: Casper Talvio Date: Tue, 2 Jan 2024 23:22:08 +0200 Subject: Add validity check to `SaveStatsPeriodically_Threaded` (#769) --- Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut index bd64e4ca..f3180214 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut @@ -1035,7 +1035,10 @@ void function SaveStatsPeriodically_Threaded() while( true ) { foreach( entity player in GetPlayerArray() ) - Stats_SaveAllStats( player ) + { + if ( IsValid( player ) ) + Stats_SaveAllStats( player ) + } wait 5 } } -- cgit v1.2.3