-
-
Notifications
You must be signed in to change notification settings - Fork 532
Enforce server-side jetpack state #4595
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
base: master
Are you sure you want to change the base?
Changes from all commits
c4f33b7
ea3f19a
004c232
6d217d2
1118597
f86d311
a74b1e2
cafdc5a
d1a6d8a
417e174
be0b04e
c884402
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2133,6 +2133,7 @@ void CGame::Packet_PlayerWasted(CPlayerWastedPacket& Packet) | |
| pPlayer->SetHealth(0.0f); | ||
| pPlayer->SetArmor(0.0f); | ||
| pPlayer->SetPosition(Packet.m_vecPosition); | ||
| pPlayer->SetHasJetPack(false); | ||
|
|
||
| // Reset his vehicle action, but only if not jacking | ||
| // If jacking we wait for him to reply with VEHICLE_NOTIFY_JACK_ABORT | ||
|
|
@@ -3363,6 +3364,10 @@ void CGame::Packet_Vehicle_InOut(CVehicleInOutPacket& Packet) | |
| // Mark him as successfully entered | ||
| pPed->SetVehicleAction(CPed::VEHICLEACTION_NONE); | ||
|
|
||
| // Remove jetpack from him | ||
| if (pPed->IsPlayer() && pPed->HasJetPack()) | ||
| pPed->SetHasJetPack(false); | ||
|
|
||
|
Comment on lines
+3367
to
+3370
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same q as above
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I’m working on it. I think I’ll find time for it over the weekend. |
||
| // Update our engine State | ||
| if (g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART)) | ||
| pVehicle->SetEngineOn(true); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4320,6 +4320,10 @@ bool CStaticFunctionDefinitions::WarpPedIntoVehicle(CPed* pPed, CVehicle* pVehic | |
| pPed->SetOccupiedVehicle(pVehicle, uiSeat); | ||
| pPed->SetVehicleAction(CPed::VEHICLEACTION_NONE); | ||
|
|
||
| // Remove jetpack if he has one | ||
| if (pPed->IsPlayer() && pPed->HasJetPack()) | ||
| pPed->SetHasJetPack(false); | ||
|
|
||
|
Comment on lines
+4323
to
+4326
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this change? Is this because we need to account for all the scenarios where the client automatically unsets the jetpack state? |
||
| // If he's the driver, switch on the engine | ||
| if (uiSeat == 0 && g_pGame->IsWorldSpecialPropertyEnabled(WorldSpecialProperty::VEHICLE_ENGINE_AUTOSTART)) | ||
| pVehicle->SetEngineOn(true); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,6 @@ bool CPlayerPuresyncPacket::Read(NetBitStreamInterface& BitStream) | |
|
|
||
| pSourcePlayer->SetInWater(flags.data.bIsInWater); | ||
| pSourcePlayer->SetOnGround(flags.data.bIsOnGround); | ||
| pSourcePlayer->SetHasJetPack(flags.data.bHasJetPack); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the specific important change for ignoring the client's opinion on the jetpack state? |
||
| pSourcePlayer->SetDucked(flags.data.bIsDucked); | ||
| pSourcePlayer->SetWearingGoggles(flags.data.bWearsGoogles); | ||
| pSourcePlayer->SetChoking(flags.data.bIsChoking); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same q as above