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

Adds checks to not normalize zero vectors #6642

Merged
merged 8 commits into from
May 31, 2024
9 changes: 9 additions & 0 deletions src/test/skript/tests/regressions/6194-vectors + push.sk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test "normalize zero vector":
set {_vector} to vector(0,0,0)
add 1 to vector length of {_vector}
assert {_vector} is vector(0,0,0) with "add to zero vector's length failed"

set vector length of {_vector} to 1
assert {_vector} is vector(0,0,0) with "set zero vector's length failed"

assert normalize {_vector} is vector(0,0,0) with "normalize zero vector failed"
Phill310 marked this conversation as resolved.
Show resolved Hide resolved