From 27f6d431ca650b933eae0441e4728e9fbe4942b6 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 12 Aug 2012 03:36:49 +0000 Subject: [PATCH] - Trying to replace an actor that does not exist is now a warning rather than an error. SVN r3820 (trunk) --- src/thingdef/thingdef.cpp | 8 +++++--- src/thingdef/thingdef.h | 2 +- src/thingdef/thingdef_parse.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index aba84b265d..a609b5e93f 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -180,7 +180,7 @@ FActorInfo *CreateNewActor(const FScriptPosition &sc, FName typeName, FName pare // //========================================================================== -void SetReplacement(FActorInfo *info, FName replaceName) +void SetReplacement(FScanner &sc, FActorInfo *info, FName replaceName) { // Check for "replaces" if (replaceName != NAME_None) @@ -190,11 +190,13 @@ void SetReplacement(FActorInfo *info, FName replaceName) if (replacee == NULL) { - I_Error ("Replaced type '%s' not found in %s", replaceName.GetChars(), info->Class->TypeName.GetChars()); + sc.ScriptMessage("Replaced type '%s' not found for %s", replaceName.GetChars(), info->Class->TypeName.GetChars()); + return; } else if (replacee->ActorInfo == NULL) { - I_Error ("Replaced type '%s' is not an actor in %s", replaceName.GetChars(), info->Class->TypeName.GetChars()); + sc.ScriptMessage("Replaced type '%s' for %s is not an actor", replaceName.GetChars(), info->Class->TypeName.GetChars()); + return; } if (replacee != NULL) { diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index a7de7285d0..e8d0f0a552 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -199,7 +199,7 @@ PSymbolActionFunction *FindGlobalActionFunction(const char *name); //========================================================================== FActorInfo *CreateNewActor(const FScriptPosition &sc, FName typeName, FName parentName, bool native); -void SetReplacement(FActorInfo *info, FName replaceName); +void SetReplacement(FScanner &sc, FActorInfo *info, FName replaceName); void HandleActorFlag(FScanner &sc, Baggage &bag, const char *part1, const char *part2, int mod); void FinishActor(const FScriptPosition &sc, FActorInfo *info, Baggage &bag); diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index a15c18e164..11c0001020 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -1108,7 +1108,7 @@ static FActorInfo *ParseActorHeader(FScanner &sc, Baggage *bag) info->DoomEdNum = DoomEdNum > 0? DoomEdNum : -1; info->Class->Meta.SetMetaString (ACMETA_Lump, Wads.GetLumpFullPath(sc.LumpNum)); - SetReplacement(info, replaceName); + SetReplacement(sc, info, replaceName); ResetBaggage (bag, info->Class->ParentClass); bag->Info = info;