Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3026 Changing vehicle model can cause network trouble #3784

Merged
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
4 changes: 4 additions & 0 deletions Client/mods/deathmatch/logic/CClientPed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,10 @@ void CClientPed::WarpIntoVehicle(CClientVehicle* pVehicle, unsigned int uiSeat)
}
}

// Wrong seat or undefined passengers count?
if ((uiSeat > 0 && uiSeat > pVehicle->m_ucMaxPassengers) || (uiSeat > 0 && pVehicle->m_ucMaxPassengers == 255))
return;

// Transfer WaitingForGroundToLoad state to vehicle
if (m_bIsLocalPlayer)
{
Expand Down
7 changes: 6 additions & 1 deletion Client/mods/deathmatch/logic/CClientVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2656,7 +2656,12 @@ void CClientVehicle::Create()
{
if (m_pPassengers[i])
{
m_pPassengers[i]->WarpIntoVehicle(this, i + 1);
// Undefined passengers count?
if (m_ucMaxPassengers != 255)
m_pPassengers[i]->WarpIntoVehicle(this, i + 1);
else
m_pPassengers[i]->SetWarpInToVehicleRequired(false);

if (m_pPassengers[i])
m_pPassengers[i]->StreamIn(true);
}
Expand Down
Loading