summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-28 08:55:52 +0200
committerGitHub <noreply@github.com>2022-03-28 08:55:52 +0200
commitc422dc5feb8cc4b16c096c1123f5df8ea96e32bc (patch)
treef973926b2ebab4176ee8843bd3eeb156fa8b60b8
parent6a74d81e025bea79dbbc35ad016ee4f891ff2945 (diff)
parentc14043b166832dd63e209ab8d92dd085e5b4af3f (diff)
Merge pull request #59064 from Chaosus/gds_fix_narrowing_conv_warning
Prevent NARROWING_CONVERSION warning for `int(float)` function in GDScript
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index af3d65d4d6..27e1520ab8 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -2303,7 +2303,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
break;
#ifdef DEBUG_ENABLED
} else {
- if (par_type.builtin_type == Variant::INT && p_call->arguments[i]->get_datatype().builtin_type == Variant::FLOAT) {
+ if (par_type.builtin_type == Variant::INT && p_call->arguments[i]->get_datatype().builtin_type == Variant::FLOAT && builtin_type != Variant::INT) {
parser->push_warning(p_call, GDScriptWarning::NARROWING_CONVERSION, p_call->function_name);
}
#endif