diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2020-03-13 05:03:40 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2020-05-09 13:43:35 -0400 |
commit | 38a0ff2249e50ddc1aebb9ec93bc446ab6b3e70b (patch) | |
tree | 279a9270ac421d1f490e790f57fe4bf5fb63f005 | |
parent | f7b50992b58afae563b6364702065fc2ac716ca4 (diff) |
Allow Vector2/Vector3 iterators to have non-integer values
-rw-r--r-- | core/variant_op.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 43f364cc56..8f4062cc69 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3458,8 +3458,8 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { return _data._float > 0.0; } break; case VECTOR2: { - int64_t from = reinterpret_cast<const Vector2 *>(_data._mem)->x; - int64_t to = reinterpret_cast<const Vector2 *>(_data._mem)->y; + double from = reinterpret_cast<const Vector2 *>(_data._mem)->x; + double to = reinterpret_cast<const Vector2 *>(_data._mem)->y; r_iter = from; @@ -3474,9 +3474,9 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const { return from < to; } break; case VECTOR3: { - int64_t from = reinterpret_cast<const Vector3 *>(_data._mem)->x; - int64_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y; - int64_t step = reinterpret_cast<const Vector3 *>(_data._mem)->z; + double from = reinterpret_cast<const Vector3 *>(_data._mem)->x; + double to = reinterpret_cast<const Vector3 *>(_data._mem)->y; + double step = reinterpret_cast<const Vector3 *>(_data._mem)->z; r_iter = from; @@ -3660,9 +3660,9 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { return true; } break; case VECTOR2: { - int64_t to = reinterpret_cast<const Vector2 *>(_data._mem)->y; + double to = reinterpret_cast<const Vector2 *>(_data._mem)->y; - int64_t idx = r_iter; + double idx = r_iter; idx++; if (idx >= to) @@ -3684,10 +3684,10 @@ bool Variant::iter_next(Variant &r_iter, bool &valid) const { return true; } break; case VECTOR3: { - int64_t to = reinterpret_cast<const Vector3 *>(_data._mem)->y; - int64_t step = reinterpret_cast<const Vector3 *>(_data._mem)->z; + double to = reinterpret_cast<const Vector3 *>(_data._mem)->y; + double step = reinterpret_cast<const Vector3 *>(_data._mem)->z; - int64_t idx = r_iter; + double idx = r_iter; idx += step; if (step < 0 && idx <= to) |