From 0468b1f9cef9864a7cd6f435f2e3961599e1f795 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 28 Jul 2013 20:05:07 -0500 Subject: [PATCH] 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. --- src/thingdef/thingdef_parse.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index 3559ee592..53c233685 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -897,8 +897,6 @@ static void ParseActionDef (FScanner &sc, PClassActor *cls) const AFuncDesc *afd; FName funcname; FString args; - TArray 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 != '+') {