- don't error out on unknown CVars for optional parameters in menu items.

This commit is contained in:
Christoph Oelckers 2017-02-13 23:24:31 +01:00
parent 32da1de385
commit 73ed351144

View file

@ -796,6 +796,9 @@ static void ParseOptionMenuBody(FScanner &sc, DOptionMenuDescriptor *desc)
auto cv = FindCVar(sc.String, nullptr); auto cv = FindCVar(sc.String, nullptr);
if (cv == nullptr && *sc.String) if (cv == nullptr && *sc.String)
{ {
if (func->Variants[0].ArgFlags[i] & VARF_Optional)
sc.ScriptMessage("Unknown CVar %s", sc.String);
else
sc.ScriptError("Unknown CVar %s", sc.String); sc.ScriptError("Unknown CVar %s", sc.String);
} }
params.Push(cv); params.Push(cv);