summaryrefslogtreecommitdiff
path: root/core/math/vector2i.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/vector2i.h')
-rw-r--r--core/math/vector2i.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/math/vector2i.h b/core/math/vector2i.h
index 3f5f12d4dd..13b70031bd 100644
--- a/core/math/vector2i.h
+++ b/core/math/vector2i.h
@@ -31,6 +31,7 @@
#ifndef VECTOR2I_H
#define VECTOR2I_H
+#include "core/error/error_macros.h"
#include "core/math/math_funcs.h"
class String;
@@ -58,9 +59,11 @@ struct _NO_DISCARD_ Vector2i {
};
_FORCE_INLINE_ int32_t &operator[](int p_idx) {
+ DEV_ASSERT((unsigned int)p_idx < 2);
return coord[p_idx];
}
_FORCE_INLINE_ const int32_t &operator[](int p_idx) const {
+ DEV_ASSERT((unsigned int)p_idx < 2);
return coord[p_idx];
}