Delete default expressions for action definitions

- After StateParams was removed in commit 4a1fbdb, the expressions for
  default paramaters that ParseActionDef() created went nowhere and were
  lost. Properly throw them away by deleting them as soon as they've been
  parsed.
This commit is contained in:
Randy Heit 2013-07-28 20:05:07 -05:00
parent 241622300e
commit 0468b1f9ce

View file

@ -897,8 +897,6 @@ static void ParseActionDef (FScanner &sc, PClassActor *cls)
const AFuncDesc *afd;
FName funcname;
FString args;
TArray<FxExpression *> DefaultParams;
bool hasdefaults = false;
if (sc.LumpNum == -1 || Wads.GetLumpFile(sc.LumpNum) > 0)
{
@ -979,18 +977,12 @@ static void ParseActionDef (FScanner &sc, PClassActor *cls)
sc.UnGet();
}
FxExpression *def;
if (sc.CheckToken('='))
{
hasdefaults = true;
flags |= OPTIONAL;
def = ParseParameter(sc, cls, type, true);
FxExpression *def = ParseParameter(sc, cls, type, true);
delete def;
}
else
{
def = NULL;
}
DefaultParams.Push(def);
if (!(flags & OPTIONAL) && type != '+')
{