aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
authorCasper Talvio <ctalvio@gmail.com>2024-01-02 23:24:14 +0200
committerGitHub <noreply@github.com>2024-01-02 22:24:14 +0100
commitaf84c42f714484e196cf0d82f9c296e3567b5f35 (patch)
tree3a192643fe53d286c5dd24e43e6138808bee02dd /Northstar.CustomServers/mod/scripts/vscripts/mp
parentfd02b453d3ada42d4fd1774737fca9559d971956 (diff)
downloadNorthstarMods-af84c42f714484e196cf0d82f9c296e3567b5f35.tar.gz
NorthstarMods-af84c42f714484e196cf0d82f9c296e3567b5f35.zip
Add validity check to `HandleDistanceAndTimeStats_Threaded` to prevent crash (#767)
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut3
1 files changed, 3 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
index f3180214..101d5e4e 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
@@ -931,6 +931,9 @@ void function HandleDistanceAndTimeStats_Threaded()
// track distance stats
foreach ( entity player in GetPlayerArray() )
{
+ if ( !IsValid( player ) )
+ continue
+
if ( player.p.lastPosForDistanceStatValid )
{
// not 100% sure on using Distance2D over Distance tbh