Skip to content

Commit

Permalink
Fix #3026 Changing vehicle model can cause network trouble (#3784)
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX authored Oct 13, 2024
1 parent 3333a11 commit 1fcd732
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 1fcd732

Please sign in to comment.