diff --git a/Client/mods/deathmatch/logic/CClientGame.cpp b/Client/mods/deathmatch/logic/CClientGame.cpp index ec81bfcbb12..069b8e0d201 100644 --- a/Client/mods/deathmatch/logic/CClientGame.cpp +++ b/Client/mods/deathmatch/logic/CClientGame.cpp @@ -1793,7 +1793,7 @@ void CClientGame::UpdateVehicleInOut() } // Are we supposed to be in a vehicle? But aren't? - if (pOccupiedVehicle && !pVehicle) + if (pOccupiedVehicle && !pVehicle && !m_pLocalPlayer->IsWarpInToVehicleRequired()) { // Jax: this happens when we try to warp into a streamed out vehicle, including when we use CClientVehicle::StreamInNow // ..maybe we need a different way to detect bike falls? diff --git a/Client/mods/deathmatch/logic/CClientPed.cpp b/Client/mods/deathmatch/logic/CClientPed.cpp index d05118ff9d4..be1d92ac853 100644 --- a/Client/mods/deathmatch/logic/CClientPed.cpp +++ b/Client/mods/deathmatch/logic/CClientPed.cpp @@ -1347,6 +1347,8 @@ void CClientPed::GetIntoVehicle(CClientVehicle* pVehicle, unsigned int uiSeat, u void CClientPed::WarpIntoVehicle(CClientVehicle* pVehicle, unsigned int uiSeat) { + SetWarpInToVehicleRequired(true); + // Ensure vehicle model is loaded CModelInfo* pModelInfo = pVehicle->GetModelInfo(); if (g_pGame->IsASyncLoadingEnabled() && !pModelInfo->IsLoaded()) @@ -4165,6 +4167,7 @@ void CClientPed::InternalWarpIntoVehicle(CVehicle* pGameVehicle) pInTask->SetIsWarpingPedIntoCar(); pInTask->ProcessPed(m_pPlayerPed); pInTask->Destroy(); + SetWarpInToVehicleRequired(false); } // If we're a remote player @@ -4180,6 +4183,8 @@ void CClientPed::InternalRemoveFromVehicle(CVehicle* pGameVehicle) { if (m_pPlayerPed && m_pTaskManager) { + SetWarpInToVehicleRequired(false); + // Reset whatever task m_pTaskManager->RemoveTask(TASK_PRIORITY_PRIMARY); diff --git a/Client/mods/deathmatch/logic/CClientPed.h b/Client/mods/deathmatch/logic/CClientPed.h index e141236aa20..595c8625580 100644 --- a/Client/mods/deathmatch/logic/CClientPed.h +++ b/Client/mods/deathmatch/logic/CClientPed.h @@ -569,6 +569,9 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule void SetTaskTypeToBeRestoredOnAnimEnd(eTaskType taskType) { m_eTaskTypeToBeRestoredOnAnimEnd = taskType; } eTaskType GetTaskTypeToBeRestoredOnAnimEnd() { return m_eTaskTypeToBeRestoredOnAnimEnd; } + bool IsWarpInToVehicleRequired() { return m_bWarpInToVehicleRequired; } + void SetWarpInToVehicleRequired(bool warp) { m_bWarpInToVehicleRequired = warp; } + void NotifyCreate(); void NotifyDestroy(); @@ -733,4 +736,5 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule ReplacedAnim_type m_mapOfReplacedAnimations; bool m_bTaskToBeRestoredOnAnimEnd; eTaskType m_eTaskTypeToBeRestoredOnAnimEnd; + bool m_bWarpInToVehicleRequired = false; };