From b2abf224b5a135d93eaf10e80a6469a4d00e20b1 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 6 Jan 2015 19:31:00 -0600 Subject: [PATCH] Save function name for error message in ParseStates() - The error "You cannot pass parameters to..." used the most recent token, which was always ( and not the function name. (Note that this was already fixed in the scripting branch, so this is probably going to be a conflict. Meh.) --- src/thingdef/thingdef_states.cpp | 5 +++-- wadsrc/static/actors/doom/demon.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 6a28e54cd..eb740aad2 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -332,7 +332,8 @@ do_stop: goto endofstate; } - PSymbol *sym = bag.Info->Class->Symbols.FindSymbol (FName(sc.String, true), true); + FName funcname = FName(sc.String, true); + PSymbol *sym = bag.Info->Class->Symbols.FindSymbol (funcname, true); if (sym != NULL && sym->SymbolType == SYM_ActionFunction) { PSymbolActionFunction *afd = static_cast(sym); @@ -434,7 +435,7 @@ do_stop: sc.MustGetString(); if (sc.Compare("(")) { - sc.ScriptError("You cannot pass parameters to '%s'\n",sc.String); + sc.ScriptError("You cannot pass parameters to '%s'\n", funcname.GetChars()); } sc.UnGet(); } diff --git a/wadsrc/static/actors/doom/demon.txt b/wadsrc/static/actors/doom/demon.txt index ecd6fa8a6..03dc5d86f 100644 --- a/wadsrc/static/actors/doom/demon.txt +++ b/wadsrc/static/actors/doom/demon.txt @@ -39,7 +39,7 @@ ACTOR Demon 3002 Goto See Death: SARG I 8 - SARG J 8 A_Scream + SARG J 8 A_Scream() SARG K 4 SARG L 4 A_NoBlocking SARG M 4