mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- fixed crash in DECORATE parsing
The case with forward declared class used as a parent must be handled explicitly actor MyWeapon : Weapon { Weapon.AmmoType "MyBaseAmmo" } actor MyAmmo : MyBaseAmmo { } actor MyBaseAmmo : Ammo { }
This commit is contained in:
parent
821cc2a140
commit
ef536e7b00
1 changed files with 8 additions and 1 deletions
|
@ -62,7 +62,14 @@ EXTERN_CVAR(Bool, strictdecorate);
|
|||
|
||||
PClassActor *DecoDerivedClass(const FScriptPosition &sc, PClassActor *parent, FName typeName)
|
||||
{
|
||||
if (parent->VMType->mVersion > MakeVersion(2, 0))
|
||||
const PClassType *const parentVMType = parent->VMType;
|
||||
|
||||
if (parentVMType == nullptr)
|
||||
{
|
||||
// Abort when forward declared class is used as a parent. This edge case cannot be handled gracefully.
|
||||
sc.Message(MSG_FATAL, "Tried to define class '%s' without definition of parent class '%s'.", typeName.GetChars(), parent->TypeName.GetChars());
|
||||
}
|
||||
else if (parentVMType->mVersion > MakeVersion(2, 0))
|
||||
{
|
||||
sc.Message(MSG_ERROR, "Parent class %s of %s not accessible to DECORATE", parent->TypeName.GetChars(), typeName.GetChars());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue