- 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,7 +796,10 @@ static void ParseOptionMenuBody(FScanner &sc, DOptionMenuDescriptor *desc)
auto cv = FindCVar(sc.String, nullptr);
if (cv == nullptr && *sc.String)
{
sc.ScriptError("Unknown CVar %s", 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);
}
params.Push(cv);
}