mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

isElementInWater returns wrong when teleporting player underwater

Open Xenius97 opened this issue 2 years ago • 3 comments

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.

Xenius97 avatar Apr 12 '22 12:04 Xenius97

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.

PlatinMTA avatar Apr 24 '22 22:04 PlatinMTA

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.

ffsPLASMA avatar May 02 '22 14:05 ffsPLASMA