From 329241d066641bb03157651441a8a4878168bf8d Mon Sep 17 00:00:00 2001 From: TEDERIs Date: Wed, 7 May 2025 11:07:35 +0700 Subject: [PATCH] Potential crash fix --- Client/multiplayer_sa/CMultiplayerSA.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Client/multiplayer_sa/CMultiplayerSA.cpp b/Client/multiplayer_sa/CMultiplayerSA.cpp index 0c6f173fbc7..8ac305efca0 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA.cpp @@ -6443,7 +6443,12 @@ void _declspec(naked) HOOK_CWorld_Remove_CPopulation_ConvertToDummyObject() TIMING_CHECKPOINT("+RemovePointerToBuilding"); RemovePointerToBuilding(); StorePointerToBuilding(); - RemoveObjectIfNeeded(); + + // pLODInterface contains a dummy object's pointer + // And as follows from CPopulation::ConvertToDummyObject this pointer can be nullptr + if (pLODInterface) + RemoveObjectIfNeeded(); + TIMING_CHECKPOINT("-RemovePointerToBuilding"); _asm {