- restored some code in PClass::CreateDerivedClass that accidentally got removed.

This commit is contained in:
Christoph Oelckers 2017-02-23 19:03:31 +01:00
parent 4bae6e81db
commit 65c4653f59

View file

@ -3219,16 +3219,24 @@ PClass *PClass::CreateDerivedClass(FName name, unsigned int size)
const PClass *existclass = FindClass(name);
// This is a placeholder so fill it in
if (existclass != NULL && existclass->Size == (unsigned)-1)
if (existclass != nullptr)
{
type = const_cast<PClass*>(existclass);
if (!IsDescendantOf(type->ParentClass))
// This is a placeholder so fill it in
if (existclass->Size == TentativeClass)
{
I_Error("%s must inherit from %s but doesn't.", name.GetChars(), type->ParentClass->TypeName.GetChars());
type = const_cast<PClass*>(existclass);
if (!IsDescendantOf(type->ParentClass))
{
I_Error("%s must inherit from %s but doesn't.", name.GetChars(), type->ParentClass->TypeName.GetChars());
}
DPrintf(DMSG_SPAMMY, "Defining placeholder class %s\n", name.GetChars());
notnew = true;
}
else
{
// a different class with the same name already exists. Let the calling code deal with this.
return nullptr;
}
DPrintf(DMSG_SPAMMY, "Defining placeholder class %s\n", name.GetChars());
notnew = true;
}
else
{