diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2017-09-15 23:39:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-15 23:39:09 +0200 |
commit | 111dae950d5f8f6052a0e3dd1a0b59da123ef38a (patch) | |
tree | a17f78b6e45b370feed1dac2c7fa66dd48181169 | |
parent | 79c7e218477011f90011e64dc991689d3e4681bd (diff) |
Revert "Don't allow division by false (zero)"
-rw-r--r-- | core/variant_op.cpp | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index be8a8de8b1..b6e114b853 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -670,34 +670,7 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, const Variant & switch (p_a.type) { DEFAULT_OP_FAIL(NIL); - case BOOL: { - switch (p_b.type) { - case BOOL: { - int64_t b = p_b._data._bool; - if (b == 0) { - - r_valid = false; - _RETURN("Division By False"); - } - _RETURN(p_a._data._bool / b); - - } break; - case INT: { - int64_t b = p_b._data._int; - if (b == 0) { - - r_valid = false; - _RETURN("Division By Zero"); - } - _RETURN(p_a._data._bool / b); - - } break; - case REAL: _RETURN(p_a._data._bool / p_b._data._real); - default: {} - } - r_valid = false; - return; - }; + DEFAULT_OP_NUM(/, BOOL, _bool); case INT: { switch (p_b.type) { case BOOL: { |