mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-04 17:08:44 +00:00
Added FindClass
Allows for classes to be looked up during run time without having to use string casting.
This commit is contained in:
parent
9f6c1d65c5
commit
236c9b4224
2 changed files with 2 additions and 1 deletions
|
@ -12367,7 +12367,7 @@ static PClass *NativeNameToClass(int _clsname, PClass *desttype)
|
|||
if (clsname != NAME_None)
|
||||
{
|
||||
cls = PClass::FindClass(clsname);
|
||||
if (cls != nullptr && (cls->VMType == nullptr || !cls->IsDescendantOf(desttype)))
|
||||
if (cls != nullptr && (cls->VMType == nullptr || (desttype != nullptr && !cls->IsDescendantOf(desttype))))
|
||||
{
|
||||
// does not match required parameters or is invalid.
|
||||
return nullptr;
|
||||
|
|
|
@ -771,6 +771,7 @@ class Object native
|
|||
private native static bool CheckDeprecatedFlags(Object obj, int index);
|
||||
|
||||
native static Name ValidateNameIndex(int index);
|
||||
static class<Object> FindClass(Name cls, class<Object> baseType = null) { return BuiltinNameToClass(cls, baseType); }
|
||||
|
||||
native static uint MSTime();
|
||||
native static double MSTimeF();
|
||||
|
|
Loading…
Reference in a new issue