diff --git a/source/funkin/backend/system/macros/FlagMacro.macro.hx b/source/funkin/backend/system/macros/FlagMacro.macro.hx index b1093bd9..607e6e53 100644 --- a/source/funkin/backend/system/macros/FlagMacro.macro.hx +++ b/source/funkin/backend/system/macros/FlagMacro.macro.hx @@ -95,6 +95,21 @@ class FlagMacro { } } + var didFind = false; + for(v in values) { + switch(expr.expr) { + case EConst(CString(s, kind)): + if(v == s) + didFind = true; + case EConst(CInt(num)): + if(v == num) + didFind = true; + default: + } + } + if(!didFind) + Context.error("Flags Allow<> must have a default value that is allowed, " + expr.toString() + " is not allowed", field.pos); + if(chosenType == NONE) Context.error("Flags Allow<> must have a type", field.pos);