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
Game.Player.Character.CurrentVehicle does not return null after leaving vehicle in v2699 #1079
Comments
I can see
|
In the script where I first noticed this behavior, I implemented a workaround by creating a void that checks However, there seems to also be odd behavior surrounding LastVehicle. In the mod, there is the ability to travel into the past and run into a clone of yourself that's performing all the tasks you did. In one check, we have Just odd behavior all around. Not sure what Rockstar did, but it appears to have been something of a doozy. |
I can't reproduce the |
Just as a follow-up for closure's sake, I discovered the root cause of the other bug. It was because a check was happening later in the code for Game.Player.Character.IsFullyOutVehicle(). That void is defined as Thus, this bug will likewise be fixed with the SHVDN update. Thanks again! |
Version
3.4.0
Description
As of the latest title update for GTA5 and SHV (2699), SHVDN is no longer returning null for Game.Player.Character.CurrentVehicle after a player leaves a vehicle. Once you enter a vehicle, Game.Player.Vehicle.CurrentVehicle is updated to the vehicle you are in. When you exit the vehicle fully, this value is nulled. If you revert GTA5 to v2628 (even leaving SHV 2699 alone), this behavior returns to normal. However, when using GTA5 v2699, this value does not return null after a player leaves any vehicle. Instead, it is updated each time the player enters a new vehicle, but is never nulled. This causes unexpected behavior in scripts which rely on knowing when a player has exited a vehicle in order to fire events.
Upon further testing, it appears there is something wrong with the underlying natives as of 2699. I do not know if this means a memory location has changed, or if Rockstar actually introduced a huge bug as of 2699.
If you return Function.Call(Hash.GET_VEHICLE_PED_IS_IN, Game.Player.Character.Handle, true), it will return the last vehicle you were in. If you change 'true' to 'false', it will still return the last vehicle you were in instead of null. However, Function.Call(Hash.IS_PED_IN_VEHICLE, Game.Player.Character.Handle, {vehiclehandle}) will return false as expected. So the game appears to be aware that you are not in a vehicle, but is not nulling the 'current vehicle'.
The text was updated successfully, but these errors were encountered: