From 2eb04ef96f3c5bc465cc2d85d7e273c5c5138303 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 4 Jun 2022 08:25:03 +0200 Subject: [PATCH] Fix variable transforms inside methods. --- game/addons/gdc_converter/gdsparser.gd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/game/addons/gdc_converter/gdsparser.gd b/game/addons/gdc_converter/gdsparser.gd index c14d87e3..318332ee 100644 --- a/game/addons/gdc_converter/gdsparser.gd +++ b/game/addons/gdc_converter/gdsparser.gd @@ -382,7 +382,15 @@ class GDSScope: s += indents + l + ";\n" continue - s += indents + l + ";\n" + if l.begins_with("var "): + if l.find("preload") != -1: + s += indents + "//" + l + ";\n" + continue + + s += indents + " " + transform_variable_to_cpp(l) + ";\n" + else: + s += indents + l + ";\n" + s += "}\n" return s