diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index d782383e7..ccfb1f75e 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -2533,6 +2533,11 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool } else if (p->Default != nullptr) { + if (flags & VARF_Out) + { + Error(p, "Out parameters cannot have default values"); + } + flags |= VARF_Optional; hasoptionals = true;