From eda55b25ee647c7fd9e4d9c0771c97366b1b5955 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 16 Jun 2017 11:58:24 +0300 Subject: [PATCH] Fixed code generation for vector parameters with default values https://forum.zdoom.org/viewtopic.php?t=56915 --- src/scripting/zscript/zcc_compile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 9f6c1fdce..5d42d64ba 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2555,7 +2555,6 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool else { auto cnst = static_cast(x); - hasdefault = true; switch (type->GetRegType()) { case REGT_INT: @@ -2583,6 +2582,8 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool break; } } + + hasdefault = true; } if (x != nullptr) delete x; }