Add validity check to `HandleDistanceAndTimeStats_Threaded` to prevent crash (#767)

This commit is contained in:
Casper Talvio 2024-01-02 23:24:14 +02:00 committed by GitHub
parent fd02b453d3
commit af84c42f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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