mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-28 23:02:07 +00:00
Allow using Self
as the class name in the default block to refer to the current class
This commit is contained in:
parent
2ba57b5068
commit
7b95977e2a
1 changed files with 15 additions and 1 deletions
|
@ -724,8 +724,15 @@ void ZCCDoomCompiler::ProcessDefaultProperty(PClassActor *cls, ZCC_PropertyStmt
|
|||
}
|
||||
else if (namenode->SiblingNext->SiblingNext == namenode)
|
||||
{
|
||||
FName name(namenode->Id);
|
||||
|
||||
if(name == NAME_self)
|
||||
{
|
||||
name = cls->TypeName;
|
||||
}
|
||||
|
||||
// a two-name property
|
||||
propname << FName(namenode->Id).GetChars() << "." << FName(static_cast<ZCC_Identifier *>(namenode->SiblingNext)->Id).GetChars();
|
||||
propname << name.GetChars() << "." << FName(static_cast<ZCC_Identifier *>(namenode->SiblingNext)->Id).GetChars();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -784,6 +791,13 @@ void ZCCDoomCompiler::ProcessDefaultFlag(PClassActor *cls, ZCC_FlagStmt *flg)
|
|||
else if (namenode->SiblingNext->SiblingNext == namenode)
|
||||
{
|
||||
// a two-name flag
|
||||
|
||||
if(namenode->Id == NAME_self)
|
||||
{
|
||||
n1 = cls->TypeName.GetChars();
|
||||
}
|
||||
|
||||
|
||||
n2 = FName(static_cast<ZCC_Identifier *>(namenode->SiblingNext)->Id).GetChars();
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue