From 565e1aaeb9fbe1f21477fd9fa5626774a1164c38 Mon Sep 17 00:00:00 2001 From: westenral <137741690+westenral@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:34:11 -0400 Subject: [PATCH] Add checks for integer vectors for integer division warning Remove warnings for invalid Vectori combinations Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com> --- modules/gdscript/gdscript_analyzer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index d4fa515a702..363f95ca5f0 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -3102,7 +3102,13 @@ void GDScriptAnalyzer::reduce_binary_op(GDScriptParser::BinaryOpNode *p_binary_o } #ifdef DEBUG_ENABLED - if (p_binary_op->variant_op == Variant::OP_DIVIDE && left_type.builtin_type == Variant::INT && right_type.builtin_type == Variant::INT) { + if (p_binary_op->variant_op == Variant::OP_DIVIDE && + (left_type.builtin_type == Variant::INT || + left_type.builtin_type == Variant::VECTOR2I || + left_type.builtin_type == Variant::VECTOR3I || + left_type.builtin_type == Variant::VECTOR4I) && + (right_type.builtin_type == Variant::INT || + right_type.builtin_type == left_type.builtin_type)) { parser->push_warning(p_binary_op, GDScriptWarning::INTEGER_DIVISION); } #endif // DEBUG_ENABLED