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 #2906: warpPedIntoVehicle causes a C++ runtime assertion failure #2920
Conversation
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.
Your change disables warping to trailers at driver seat too.
How about also adding seat < MAX_VEHICLE_SEATS
checks to CVehicle::SetOccupant
and CPed::SetOccupiedVehicle
?
That would be a good idea, I'll check it |
Or maybe just only to |
Damn, i mismatched the sign, Co-authored-by: lopez <7338099+lopezloo@users.noreply.github.com>
Removed seat check in CPed.cpp
Changed seat check to include values less than 0 and bigger than max passengers of a vehicle
It's still not possible to warp player to driver seat in trailer vehicles like it was before. Excluding seat 0 in |
Reformatted seat check. Now its possible to enter vehicle as a driver on trailers
Increased readability Co-authored-by: lopez <7338099+lopezloo@users.noreply.github.com>
Fixed a typo
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.
Looks good to me. Thank you.
GetMaxPassengers()
returnsVEHICLE_PASSENGERS_UNDEFINED
if the amount of seat is undefined (this happens mainly on trailers). We can't warp player to a vehicle that doesn't have seats.By adding this fix, server wont crash from runtime exception when warping to a vehicle that doesnt have "enough" seats
In #2918 I fixed the issue but my repo and branch got corrupted and broke the whole PR (couldnt change the commit, add or remove files). Sorry