summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/variant_op.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index d193858966..9f172f0d57 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -2149,7 +2149,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
int idx = p_index;
if (idx < 0)
idx += 4;
- if (idx >= 0 || idx < 4) {
+ if (idx >= 0 && idx < 4) {
Color *v = reinterpret_cast<Color *>(_data._mem);
(*v)[idx] = p_value;
valid = true;
@@ -2524,7 +2524,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
int idx = p_index;
if (idx < 0)
idx += 4;
- if (idx >= 0 || idx < 4) {
+ if (idx >= 0 && idx < 4) {
const Color *v = reinterpret_cast<const Color *>(_data._mem);
valid = true;
return (*v)[idx];