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

isVehicleOnGround sometimes returns false incorrectly #471

Open
ArranTuna opened this issue Sep 16, 2018 · 4 comments
Open

isVehicleOnGround sometimes returns false incorrectly #471

ArranTuna opened this issue Sep 16, 2018 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@ArranTuna
Copy link
Collaborator

ArranTuna commented Sep 16, 2018

Describe the bug
isVehicleOnGround returns false on some vehicles upside down and isVehicleOnGround always returns false for Monsters.

Vehicle IDs: 444, 556, 557

isVehicleOnGround(getPedOccupiedVehicle(localPlayer)) always return false

To Reproduce

  • Spawn a monster (444, 556 or 557)
  • crun isVehicleOnGround(getPedOccupiedVehicle(localPlayer))

Expected behavior
Should return true

Screenshots
image

MTA Client (please complete the following information):
unstated

MTA Server (please complete the following information):
unstated

Additional context
From mantis 7880 and mantis 8672

@ArranTuna ArranTuna added the bug Something isn't working label Sep 16, 2018
@qaisjp qaisjp changed the title isVehicleOnGround returning false when shouldn't isVehicleOnGround sometimes returns false incorrectly Sep 21, 2018
@qaisjp
Copy link
Contributor

qaisjp commented Sep 21, 2018

The Monster problem should be fixed but I am not sure about vehicles that are upside down (yet on the ground) or vehicles driving on walls (with setVehicleGravity).

I invite suggestions and comments

@Yamsha75
Copy link

Monster problem is still present in v1.5.9-release-21024.1. I encountered the same issue for Dune. It must be something related to their unusual suspension. Lowering suspensionForceLevel in handling fixes the problem (to 0.2 for Monster or 0.4 for Dune). That change is a bit too much for those vehicles, but maybe this will be of some help in figuring out the underlying problem

@Dutchman101
Copy link
Member

Dutchman101 commented Nov 23, 2021

It must be something related to their unusual suspension. Lowering suspensionForceLevel in handling fixes the problem

seems very related to issue #2093 as well, and all stuff tied to it comes back to unusual suspension values. For the latter, also see my comment on that issue.

@Yamsha75
Copy link

Yamsha75 commented Jan 11, 2022

Not sure about unsual suspension values, but for typical situations using isVehicleWheelOnGround is good enough and in most cases even more precise. Just keep in mind what you consider "vehicle on ground" for your use case, in other words, which combination of wheels on ground makes the vehicle on ground: all wheels, only driven wheels, or any single wheel. Works for Monster and Dune in all my use cases anyway

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

No branches or pull requests

4 participants