mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 16:11:23 +00:00
- added validation for presence of drop item classes
https://forum.zdoom.org/viewtopic.php?t=65307
This commit is contained in:
parent
8efe18b3ba
commit
b7e0a8d2c7
1 changed files with 23 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue