Re-allow indexes as state parameter in sequences

This commit is contained in:
Leonard2 2016-08-05 17:26:33 +02:00 committed by Christoph Oelckers
commit db9f4c1385
4 changed files with 120 additions and 11 deletions

View file

@ -138,23 +138,30 @@ FxExpression *ParseParameter(FScanner &sc, PClassActor *cls, PType *type, bool c
else if (type == TypeState)
{
// This forces quotation marks around the state name.
sc.MustGetToken(TK_StringConst);
if (sc.String[0] == 0 || sc.Compare("None"))
if (sc.CheckToken(TK_StringConst))
{
x = new FxConstant((FState*)NULL, sc);
}
else if (sc.Compare("*"))
{
if (constant)
if (sc.String[0] == 0 || sc.Compare("None"))
{
x = new FxConstant((FState*)(intptr_t)-1, sc);
x = new FxConstant((FState*)NULL, sc);
}
else if (sc.Compare("*"))
{
if (constant)
{
x = new FxConstant((FState*)(intptr_t)-1, sc);
}
else sc.ScriptError("Invalid state name '*'");
}
else
{
x = new FxMultiNameState(sc.String, sc);
}
else sc.ScriptError("Invalid state name '*'");
}
else
else if (!constant)
{
x = new FxMultiNameState(sc.String, sc);
x = new FxRuntimeStateIndex(ParseExpression(sc, cls));
}
else sc.MustGetToken(TK_StringConst); // This is for the error.
}
else if (type->GetClass() == RUNTIME_CLASS(PClassPointer))
{ // Actor name