diff options
author | Bartłomiej T. Listwon <blistwon@gmail.com> | 2022-02-09 09:17:17 +0100 |
---|---|---|
committer | Bartłomiej T. Listwon <blistwon@gmail.com> | 2022-02-09 09:17:17 +0100 |
commit | 51cac0709e9c053b0785fc11cd26cb9cc83c01ae (patch) | |
tree | 91474421d12857861a13cdaf794e7524c224044d /core/math/vector2.h | |
parent | d435c51cda529cc85a945fb909217dd6b0dc531b (diff) | |
download | redot-engine-51cac0709e9c053b0785fc11cd26cb9cc83c01ae.tar.gz |
Fix Vector2 and Vector2i coord access via operator[]
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r-- | core/math/vector2.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h index 123e3dc7b6..92ac5257b0 100644 --- a/core/math/vector2.h +++ b/core/math/vector2.h @@ -60,10 +60,10 @@ struct _NO_DISCARD_ Vector2 { }; _FORCE_INLINE_ real_t &operator[](int p_idx) { - return p_idx ? y : x; + return coord[p_idx]; } _FORCE_INLINE_ const real_t &operator[](int p_idx) const { - return p_idx ? y : x; + return coord[p_idx]; } _FORCE_INLINE_ void set_all(const real_t p_value) { |