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

bCheckWaves argument in getWaterLevel() does nothing #458

Closed
Einheit-101 opened this issue Sep 13, 2018 · 5 comments
Closed

bCheckWaves argument in getWaterLevel() does nothing #458

Einheit-101 opened this issue Sep 13, 2018 · 5 comments
Labels
bug Something isn't working documentation

Comments

@Einheit-101
Copy link

Describe the bug
Currently getWaterLevel() returns the same values, no matter if bCheckWaves is true or false.

To Reproduce

  1. go to map editor, go to water
  2. set wave height to 0.2 in admin panel
  3. crun x, y, z = getElementPosition(me)
  4. crun getWaterLevel(x, y, z, true) ->> returns correct water level with waves taken into account
  5. crun getWaterLevel(x, y, z, false) ->> still returns water level with waves taken into account

Expected behavior
getWaterLevel(x, y, z, false) should return a constant number, the actual water level that has been set with setWaterLevel() or the default water level, in this case 0.2. It should not take care of wave height.

MTA Client (please complete the following information):
MTA SA 1.5.6 for Windows r14334

@ArranTuna ArranTuna added the bug Something isn't working label Sep 13, 2018
@botder botder added this to the Backlog milestone Mar 3, 2019
@botder
Copy link
Member

botder commented Aug 10, 2021

That parameter does not let you ignore the waves, this is just bad naming.
That parameter makes the function return false, if the difference between reported water level and provided z value is greated than 3.0, or: (level - positionZ) > 3.0.

@botder
Copy link
Member

botder commented Aug 10, 2021

If there is demand for a getWaterLevel, which ignores water level, then I could create a pull request for that: https://github.com/botder/mtasa-blue/tree/feature/waterlevel-nowaves. That branch adds getWaterLevelNoWaves, which returns the z position followed by the wave cos/sin values.

@Einheit-101
Copy link
Author

I think there is no real need for this. I recommend changing wiki description, maybe. But would it be possible to hide that wave quad with a new function to be able to replace it with a custom wave shader? Right now GTA is rendering 2 water surfaces together, one being the flat water and one being the animated waves.

@botder
Copy link
Member

botder commented Aug 10, 2021

I changed the description in the wiki. Create a new issue if you want a new feature for world water/waves.

botder added a commit that referenced this issue Aug 10, 2021
@Einheit-101 Einheit-101 reopened this Aug 10, 2021
@patrikjuvonen patrikjuvonen removed this from the Backlog milestone Sep 23, 2021
@patrikjuvonen
Copy link
Contributor

Change reflected on Wiki https://wiki.multitheftauto.com/wiki/GetWaterLevel
Issue closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation
Projects
None yet
Development

No branches or pull requests

4 participants