Skip to content

Commit 3455837

Browse files
authored
Fix Camper's third seat not working (#4578)
* Fix camper third seat
1 parent 243ef24 commit 3455837

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6660,6 +6660,10 @@ bool CClientPed::EnterVehicle(CClientVehicle* pVehicle, bool bPassenger)
66606660
return false;
66616661
}
66626662

6663+
// Validate camper seat to avoid multiple occupants && desyncronization
6664+
if (vehicleModel == VehicleType::VT_CAMPER && uiSeat > 0 && pVehicle->GetOccupant(uiSeat))
6665+
return false;
6666+
66636667
// Call the onClientVehicleStartEnter event for the ped
66646668
// Check if it is cancelled before sending packet
66656669
CLuaArguments Arguments;

Client/mods/deathmatch/logic/CClientVehicleManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const SFixedArray<unsigned char, 212> g_ucMaxPassengers = {3, 1, 1, 1, 3,
2121
0, 1, 1, 255, 1, 8, 3, 1, 3, 0, 1, 1, 1, 3, 0, 1, // 432->447
2222
0, 1, 255, 1, 0, 0, 0, 1, 1, 1, 3, 3, 1, 1, 1, // 448->462
2323
1, 1, 1, 3, 3, 1, 1, 3, 1, 0, 0, 1, 1, 0, 1, 1, // 463->478
24-
3, 1, 0, 3, 1, 0, 0, 0, 3, 1, 1, 3, 1, 3, 0, 1, // 479->494
24+
3, 1, 0, 3, 3, 0, 0, 0, 3, 1, 1, 3, 1, 3, 0, 1, // 479->494
2525
1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, 0, // 495->510
2626
1, 0, 0, 1, 1, 3, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, // 511->526
2727
1, 1, 3, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 3, 1, // 527->541

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9963,6 +9963,10 @@ bool CStaticFunctionDefinitions::WarpPedIntoVehicle(CClientPed* pPed, CClientVeh
99639963
if (pPed->IsLocalEntity() != pVehicle->IsLocalEntity())
99649964
return false;
99659965

9966+
// Camper only has 3 seats (0-2)
9967+
if (static_cast<VehicleType>(pVehicle->GetModel()) == VehicleType::VT_CAMPER && uiSeat > 2)
9968+
return false;
9969+
99669970
if (pPed->IsLocalEntity())
99679971
{
99689972
//

Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4280,6 +4280,10 @@ bool CStaticFunctionDefinitions::WarpPedIntoVehicle(CPed* pPed, CVehicle* pVehic
42804280
if (uiSeat > 0 && pVehicle->GetMaxPassengers() == VEHICLE_PASSENGERS_UNDEFINED)
42814281
return false;
42824282

4283+
// Camper only has 3 seats (0-2)
4284+
if (pVehicle->GetModel() == VT_CAMPER && uiSeat > 2)
4285+
return false;
4286+
42834287
// Valid seat id for that vehicle?
42844288
// Temp fix: Disable driver seat for train carriages since the whole vehicle sync logic is based on the the player on the first seat being the vehicle
42854289
// syncer (Todo)

Server/mods/deathmatch/logic/CVehicleManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static const SFixedArray<unsigned char, 212> g_ucMaxPassengers = {{3, 1, 1,
1919
0, 1, 1, 255, 1, 8, 3, 1, 3, 0, 1, 1, 1, 3, 0, 1, // 432->447
2020
0, 1, 255, 1, 0, 0, 0, 1, 1, 1, 3, 3, 1, 1, 1, // 448->462
2121
1, 1, 1, 3, 3, 1, 1, 3, 1, 0, 0, 1, 1, 0, 1, 1, // 463->478
22-
3, 1, 0, 3, 1, 0, 0, 0, 3, 1, 1, 3, 1, 3, 0, 1, // 479->494
22+
3, 1, 0, 3, 3, 0, 0, 0, 3, 1, 1, 3, 1, 3, 0, 1, // 479->494
2323
1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, 0, // 495->510
2424
1, 0, 0, 1, 1, 3, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, // 511->526
2525
1, 1, 3, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 3, 1, // 527->541

0 commit comments

Comments
 (0)