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
Fix #2178: testLineAgainstWater works incorrectly outside of game boundaries #2192
Conversation
I don't see a reason to remove that check, and i doubt you tested those cases or checked what happens in the code further down |
Because thats what this PR is all about, if both of the ends will be outside area, it will automatically return false, we dont want that to happen, we want to be able to check if line is hitting the water in any case, and yeah - i tested that and it worked just fine. Some users might want to get out of Game Area(for some reason, i'm not here to judge), and we should allow that. |
And they still can, the code you commented out doesn't change anything about that, it just skips unnecessary calculations later on. No water other than ocean water will ever be collided outside of -3000 : 3000 range because You can't create custom water outside that |
Check for the GetZonesIntersecting behaviour when you check line starting from (-3050, -3050, 10) to (3050, -3050, 10) when ocean water level is 0, it will do unnecessary checks around the world border if I'm not mistaken after You commented the code out |
Yeah, but the code returns false, it doesnt even check if the line really collides with water, as far as i see it only checks for X and Y. -Are both points outside of map? |
You literally check for ocean water collision few lines up, no other water will ever exist there, as it can't be created |
After thinking it out, you might be right, further code checks for waves as i see? Forgot the ocean water doesnt have waves at all, so that can make sense. Getting commented code back, leaving the higher fix tho. |
After all the checks are done, i guess we're ready to merge, as the change itself worked well in my tests. |
Changed zeroPoint name as it is now considering waterHeight, so it's not always returning '0' as Z withing CVector.
watertest.zip |
For some reason it returns true if water level is lower than 0, and we check at Z=0(or lower), i guess its due to |
Did you check his suggested fix in the original issue #2178? |
i got some help, i'll introduce it soon but for now i have some work to do |
# Conflicts: # Client/game_sa/CWaterManagerSA.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I hope you've tested it.
Just added a check for water level outside Game Area, and commened out a check if both points are outside Game Area(why would we check for that lol).
Fixes #2178