mtasa-blue
mtasa-blue copied to clipboard
isElementInWater returns wrong when teleporting player underwater
Describe the bug
isElementInWater returns always false when teleporting player underwater (client + server side too)
Steps to reproduce
srun source:setPosition(1439.7230224609, -249.67440795898, -8.6027641296387)
crun isElementInWater(localPlayer)
Version
Multi Theft Auto v1.5.9-release-21166
Additional context
https://i.imgur.com/ZyVbQzV.jpeg
Relevant log output
No response
Security Policy
- [X] I have read and understood the Security Policy and this issue is not security related.
It seems like it only checks whenever you are swimming. Vehicles do return true when on water even if they are not sinking, so players should have the same treatment in my opinion.
I wouldn't call it a bug, rather a sideeffect of bypassing game mechanics by teleporting player ped into water element rather than letting it touch it manually. Fixing would bring more issues and propably backwards issues as the functions relies on the peds animation/state and vehicle engine state/status I guess. Also there's not sufficient way to check if the player ped is under water if it behaves as being on ground.