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; }