Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
5 changes: 5 additions & 0 deletions Client/mods/deathmatch/logic/CClientPed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand All @@ -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);

Expand Down
4 changes: 4 additions & 0 deletions Client/mods/deathmatch/logic/CClientPed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -733,4 +736,5 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
ReplacedAnim_type m_mapOfReplacedAnimations;
bool m_bTaskToBeRestoredOnAnimEnd;
eTaskType m_eTaskTypeToBeRestoredOnAnimEnd;
bool m_bWarpInToVehicleRequired = false;
};