- Implemented ZScript abstract functions

This commit is contained in:
Player701 2020-10-10 11:24:49 +03:00 committed by Christoph Oelckers
commit 761dea8640
9 changed files with 82 additions and 22 deletions

View file

@ -78,6 +78,19 @@ PClassActor *DecoDerivedClass(const FScriptPosition &sc, PClassActor *parent, FN
{
sc.Message(MSG_ERROR, "Parent class %s of %s not accessible to DECORATE", parent->TypeName.GetChars(), typeName.GetChars());
}
else
{
// [Player701] Parent class must not have abstract functions
for (auto v : parent->Virtuals)
{
if (v->VarFlags & VARF_Abstract)
{
sc.Message(MSG_ERROR, "Parent class %s of %s cannot have abstract functions.", parent->TypeName.GetChars(), typeName.GetChars());
break;
}
}
}
bool newlycreated;
PClassActor *type = static_cast<PClassActor *>(parent->CreateDerivedClass(typeName, parent->Size, &newlycreated));
if (type == nullptr)