mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-02 00:11:59 +00:00
- fixed processing of parameter-less ZScript properties.
This commit is contained in:
parent
2f420d65cd
commit
7a61f1a779
1 changed files with 12 additions and 3 deletions
|
@ -1783,14 +1783,23 @@ void ZCCCompiler::DispatchScriptProperty(PProperty *prop, ZCC_PropertyStmt *prop
|
||||||
ZCC_ExprConstant one;
|
ZCC_ExprConstant one;
|
||||||
unsigned parmcount = 1;
|
unsigned parmcount = 1;
|
||||||
ZCC_TreeNode *x = property->Values;
|
ZCC_TreeNode *x = property->Values;
|
||||||
while (x->SiblingNext != property->Values)
|
if (x == nullptr)
|
||||||
{
|
{
|
||||||
x = x->SiblingNext;
|
parmcount = 0;
|
||||||
parmcount++;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (x->SiblingNext != property->Values)
|
||||||
|
{
|
||||||
|
x = x->SiblingNext;
|
||||||
|
parmcount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (parmcount == 0 && prop->Variables.Size() == 1 && prop->Variables[0]->Type == TypeBool)
|
if (parmcount == 0 && prop->Variables.Size() == 1 && prop->Variables[0]->Type == TypeBool)
|
||||||
{
|
{
|
||||||
// allow boolean properties to have the parameter omitted
|
// allow boolean properties to have the parameter omitted
|
||||||
|
memset(&one, 0, sizeof(one));
|
||||||
|
one.SourceName = property->SourceName; // This may not be null!
|
||||||
one.Operation = PEX_ConstValue;
|
one.Operation = PEX_ConstValue;
|
||||||
one.NodeType = AST_ExprConstant;
|
one.NodeType = AST_ExprConstant;
|
||||||
one.Type = TypeBool;
|
one.Type = TypeBool;
|
||||||
|
|
Loading…
Reference in a new issue