Skip to content
Permalink
Browse files

- added validation for presence of drop item classes

  • Loading branch information...
alexey-lysiuk authored and coelckers committed Jul 11, 2019
1 parent 8efe18b commit b7e0a8d2c74cf7907cf44d12ee97f608b0cf0c21
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/scripting/thingdef.cpp
@@ -419,6 +419,27 @@ static void CheckStates(PClassActor *obj)
}
}

void CheckDropItems(const PClassActor *const obj)
{
const FDropItem *dropItem = obj->ActorInfo()->DropItems;

while (dropItem != nullptr)
{
if (dropItem->Name != NAME_None)
{
const char *const dropItemName = dropItem->Name.GetChars();

if (dropItemName[0] != '\0' && PClass::FindClass(dropItem->Name) == nullptr)
{
Printf(TEXTCOLOR_ORANGE "Undefined drop item class %s referenced from actor %s\n", dropItemName, obj->TypeName.GetChars());
FScriptPosition::WarnCounter++;
}
}

dropItem = dropItem->Next;
}
}

//==========================================================================
//
// LoadActors
@@ -500,6 +521,8 @@ void LoadActors()
// PASSMOBJ is irrelevant for normal missiles, but not for bouncers.
defaults->flags2 |= MF2_PASSMOBJ;
}

CheckDropItems(ti);
}
if (FScriptPosition::ErrorCounter > 0)
{

0 comments on commit b7e0a8d

Please sign in to comment.
You can’t perform that action at this time.