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

[1.6] Fix door sync #143

Closed
wants to merge 4 commits into from
Closed

Conversation

lopezloo
Copy link
Member

@lopezloo lopezloo commented May 26, 2017

Fixes few vehicle door issues. It's still not perfect but way better than before. Fixes #453.

Issue 1

Passenger door freezes mid entering sometimes.

Reported on mantis as #8546.

Issue 2

Sometimes door closes mid jacking a driver.

Before: https://youtu.be/MsmkJqCVYhI
After: https://youtu.be/wvIvaJpu9LM

Issue 3

Sometimes doors closes mid entering as passenger.

Before: https://youtu.be/VJkfvId-tL4
After: https://youtu.be/rgYSBXbexCs

Issue 4

Driver door don't close if you jack a player from passenger side.

Before: https://youtu.be/I3h0XgTSTCU
After: https://youtu.be/GQ0KfVr-l0Q
After#2: https://youtu.be/s9TWCEED8AI (warpPedIntoVehicle case)

Issue 5

Doors freezes after (any) player exit passenger seat.

Before: https://youtu.be/mqLpPFP-6Ng
After: https://youtu.be/aRcGjbOyeCw

Issue 6

setVehicleDoorState doesn't work for certain states.

Reported on mantis as #4185.
Before: https://youtu.be/IkWj0CW88JI
After: https://youtu.be/EhNhAKhiiO4

Issue 7

Fallen off door and panel components spawn near vehicle on stream in.

Mentioned in #3449
Before: https://youtu.be/He52i70rQjY
After: https://youtu.be/WK2V34vt5z4
(notice how lovely windshield breaks)

float fRatio = pVehicle->GetDoorOpenRatio ( pPlayer->m_ucEnteringDoor );
if ( fRatio > 0 )
{
pVehicle->SetDoorOpenRatio ( pPlayer->m_ucEnteringDoor, 0, 0, true );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed issue 1.

// so he will be able to close it
if ( pInsidePlayer->m_ucEnteringDoor == 3 && pVehicle->GetDoorAjarStatus ( 2 ) == false )
{
pVehicle->SetDoorAjarStatus ( 2, true );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue 4.

else if ( ucStatus == DT_DOOR_SWINGING_FREE )
{
// Set it to intact first
SetDoorStatus ( ucDoor, DT_DOOR_INTACT, bFlyingComponent );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important for issue 6.

pVehicle->SetSwingingDoorsAllowed ( false );
if ( m_bIsLocalPlayer )
{
pVehicle->SetSwingingDoorsAllowed ( false );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue 5.

// Are we making it intact?
if ( bDoorStatus == DT_DOOR_INTACT || bDoorStatus == DT_DOOR_SWINGING_FREE )
// Update door model (only if needed - this gonna shut the door)
if ( bOldBashed != bNewBashed || bDoorStatus == DT_DOOR_MISSING || ucOldStatus == DT_DOOR_MISSING )
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue 2 & 3. Updating door model causes angle reset so we want to avoid this in some situations (for example changing from state 0 to 1).

@lopezloo lopezloo added the bug Something isn't working label May 26, 2017
@lopezloo lopezloo changed the title Fix door sync [1.6] Fix door sync Jun 13, 2017
@lopezloo lopezloo added this to the 1.6 milestone Jun 13, 2017
@Necktrox Necktrox added pr:needs-testing feedback Further information is requested labels Dec 15, 2017
@Necktrox
Copy link
Contributor

I managed to freeze a passenger door, is this part of the issue 5 or not?

Door Sync

@lopezloo
Copy link
Member Author

^
No, it looks more like issue 1.

Closing this for now. I will create seperate issues for this and later try to merge some fixes into 1.5.x (if possible).

@lopezloo lopezloo closed this Oct 12, 2018
@lopezloo lopezloo removed this from the 1.6 milestone Oct 12, 2018
@lopezloo lopezloo removed the feedback Further information is requested label Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Car door desync (open state)
4 participants