mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 23:11:58 +00:00
- fixed: BuiltinNameToClass should treat NAME_None as 'nothing'.
It's names that get here, after all, so the name for 'nothing' should actually mean 'nothing' here.
This commit is contained in:
parent
82e5e2daa9
commit
c2f7ed7f1c
1 changed files with 11 additions and 7 deletions
|
@ -9150,15 +9150,19 @@ int BuiltinNameToClass(VMFrameStack *stack, VMValue *param, TArray<VMValue> &def
|
|||
assert(ret->RegType == REGT_POINTER);
|
||||
|
||||
FName clsname = ENamedName(param[0].i);
|
||||
if (clsname != NAME_None)
|
||||
{
|
||||
const PClass *cls = PClass::FindClass(clsname);
|
||||
const PClass *desttype = reinterpret_cast<PClass *>(param[1].a);
|
||||
|
||||
if (!cls->IsDescendantOf(desttype))
|
||||
{
|
||||
Printf("class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
|
||||
Printf("class '%s' is not compatible with '%s'\n", clsname.GetChars(), desttype->TypeName.GetChars());
|
||||
cls = nullptr;
|
||||
}
|
||||
ret->SetPointer(const_cast<PClass *>(cls), ATAG_OBJECT);
|
||||
}
|
||||
else ret->SetPointer(nullptr, ATAG_OBJECT);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue