From a1e4d088289adfc3a66356809d42b903b68f0ff1 Mon Sep 17 00:00:00 2001 From: wootguy Date: Sat, 11 Jan 2025 17:32:08 -0800 Subject: [PATCH] fix crash spamming train controls --- dlls/player/CBasePlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/player/CBasePlayer.cpp b/dlls/player/CBasePlayer.cpp index 45d1b82f..83d2ef45 100644 --- a/dlls/player/CBasePlayer.cpp +++ b/dlls/player/CBasePlayer.cpp @@ -2481,7 +2481,7 @@ void CBasePlayer::PreThink(void) //ALERT( at_error, "In train mode with no train!\n" ); m_afPhysicsFlags &= ~PFLAG_ONTRAIN; m_iTrain = TRAIN_NEW|TRAIN_OFF; - if (pTrain->Classify() == CLASS_VEHICLE) + if (pTrain && pTrain->Classify() == CLASS_VEHICLE) ((CFuncVehicle*)pTrain)->m_pDriver = NULL; return; }