mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 21:52:51 +00:00
Fix subtracting colors and quats
This commit is contained in:
parent
339b64697c
commit
4c232e4222
@ -1399,6 +1399,8 @@ void Variant::_register_variant_operators() {
|
|||||||
register_op<OperatorEvaluatorSub<Vector2i, Vector2i, Vector2i>>(Variant::OP_SUBTRACT, Variant::VECTOR2I, Variant::VECTOR2I);
|
register_op<OperatorEvaluatorSub<Vector2i, Vector2i, Vector2i>>(Variant::OP_SUBTRACT, Variant::VECTOR2I, Variant::VECTOR2I);
|
||||||
register_op<OperatorEvaluatorSub<Vector3, Vector3, Vector3>>(Variant::OP_SUBTRACT, Variant::VECTOR3, Variant::VECTOR3);
|
register_op<OperatorEvaluatorSub<Vector3, Vector3, Vector3>>(Variant::OP_SUBTRACT, Variant::VECTOR3, Variant::VECTOR3);
|
||||||
register_op<OperatorEvaluatorSub<Vector3i, Vector3i, Vector3i>>(Variant::OP_SUBTRACT, Variant::VECTOR3I, Variant::VECTOR3I);
|
register_op<OperatorEvaluatorSub<Vector3i, Vector3i, Vector3i>>(Variant::OP_SUBTRACT, Variant::VECTOR3I, Variant::VECTOR3I);
|
||||||
|
register_op<OperatorEvaluatorSub<Quat, Quat, Quat>>(Variant::OP_SUBTRACT, Variant::QUAT, Variant::QUAT);
|
||||||
|
register_op<OperatorEvaluatorSub<Color, Color, Color>>(Variant::OP_SUBTRACT, Variant::COLOR, Variant::COLOR);
|
||||||
|
|
||||||
register_op<OperatorEvaluatorMul<int64_t, int64_t, int64_t>>(Variant::OP_MULTIPLY, Variant::INT, Variant::INT);
|
register_op<OperatorEvaluatorMul<int64_t, int64_t, int64_t>>(Variant::OP_MULTIPLY, Variant::INT, Variant::INT);
|
||||||
register_op<OperatorEvaluatorMul<double, int64_t, double>>(Variant::OP_MULTIPLY, Variant::INT, Variant::FLOAT);
|
register_op<OperatorEvaluatorMul<double, int64_t, double>>(Variant::OP_MULTIPLY, Variant::INT, Variant::FLOAT);
|
||||||
|
@ -1611,7 +1611,7 @@ void GDScriptAnalyzer::reduce_binary_op(GDScriptParser::BinaryOpNode *p_binary_o
|
|||||||
if (p_binary_op->reduced_value.get_type() == Variant::STRING) {
|
if (p_binary_op->reduced_value.get_type() == Variant::STRING) {
|
||||||
push_error(vformat(R"(%s in operator %s.)", p_binary_op->reduced_value, Variant::get_operator_name(p_binary_op->variant_op)), p_binary_op);
|
push_error(vformat(R"(%s in operator %s.)", p_binary_op->reduced_value, Variant::get_operator_name(p_binary_op->variant_op)), p_binary_op);
|
||||||
} else {
|
} else {
|
||||||
push_error(vformat(R"(Invalid operands to operator %s, %s and %s.".)",
|
push_error(vformat(R"(Invalid operands to operator %s, %s and %s.)",
|
||||||
Variant::get_operator_name(p_binary_op->variant_op),
|
Variant::get_operator_name(p_binary_op->variant_op),
|
||||||
Variant::get_type_name(p_binary_op->left_operand->reduced_value.get_type()),
|
Variant::get_type_name(p_binary_op->left_operand->reduced_value.get_type()),
|
||||||
Variant::get_type_name(p_binary_op->right_operand->reduced_value.get_type())),
|
Variant::get_type_name(p_binary_op->right_operand->reduced_value.get_type())),
|
||||||
|
Loading…
Reference in New Issue
Block a user