Skip to content

Commit b4e8bf7

Browse files
committed
Fix crash
1 parent d8db5e8 commit b4e8bf7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Client/mods/deathmatch/logic/CClientIMG.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ bool CClientIMG::LinkModel(unsigned int uiModelID, size_t uiFileID)
211211

212212
m_restoreInfo.emplace_back(uiModelID, pCurrInfo->offsetInBlocks, pCurrInfo->sizeInBlocks, pCurrInfo->archiveId);
213213

214+
// Internally stream out the vehicle before calling CStreamingSA::RemoveModel
215+
// otherwise a crash will occur if the player is inside a vehicle that gets unloaded by the streamer
216+
if (CClientVehicleManager::IsValidModel(uiModelID))
217+
g_pClientGame->GetVehicleManager()->RestreamVehicles(static_cast<unsigned short>(uiModelID));
218+
214219
g_pGame->GetStreaming()->SetStreamingInfo(uiModelID, m_ucArchiveID, pFileInfo->uiOffset, pFileInfo->usSize);
215220

216221
return true;

0 commit comments

Comments
 (0)