- Trying to replace an actor that does not exist is now a warning rather than an error.

SVN r3820 (trunk)
This commit is contained in:
Randy Heit 2012-08-12 03:36:49 +00:00
parent 2a9a1fb240
commit 27f6d431ca
3 changed files with 7 additions and 5 deletions

View file

@ -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" // Check for "replaces"
if (replaceName != NAME_None) if (replaceName != NAME_None)
@ -190,11 +190,13 @@ void SetReplacement(FActorInfo *info, FName replaceName)
if (replacee == NULL) 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) 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) if (replacee != NULL)
{ {

View file

@ -199,7 +199,7 @@ PSymbolActionFunction *FindGlobalActionFunction(const char *name);
//========================================================================== //==========================================================================
FActorInfo *CreateNewActor(const FScriptPosition &sc, FName typeName, FName parentName, bool native); 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 HandleActorFlag(FScanner &sc, Baggage &bag, const char *part1, const char *part2, int mod);
void FinishActor(const FScriptPosition &sc, FActorInfo *info, Baggage &bag); void FinishActor(const FScriptPosition &sc, FActorInfo *info, Baggage &bag);

View file

@ -1108,7 +1108,7 @@ static FActorInfo *ParseActorHeader(FScanner &sc, Baggage *bag)
info->DoomEdNum = DoomEdNum > 0? DoomEdNum : -1; info->DoomEdNum = DoomEdNum > 0? DoomEdNum : -1;
info->Class->Meta.SetMetaString (ACMETA_Lump, Wads.GetLumpFullPath(sc.LumpNum)); info->Class->Meta.SetMetaString (ACMETA_Lump, Wads.GetLumpFullPath(sc.LumpNum));
SetReplacement(info, replaceName); SetReplacement(sc, info, replaceName);
ResetBaggage (bag, info->Class->ParentClass); ResetBaggage (bag, info->Class->ParentClass);
bag->Info = info; bag->Info = info;