mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Update sqratClassType.h
This commit is contained in:
parent
33979d4c97
commit
3e0280a3c4
@ -251,6 +251,20 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void PushInstance(HSQUIRRELVM vm, C* ptr, std::nullptr_t) {
|
||||||
|
if (!ptr) {
|
||||||
|
sq_pushnull(vm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClassData<C>* cd = getClassData(vm);
|
||||||
|
|
||||||
|
typename std::unordered_map<C*, HSQOBJECT>::iterator it = cd->instances->find(ptr);
|
||||||
|
if (it != cd->instances->end()) {
|
||||||
|
sq_pushobject(vm, it->second);
|
||||||
|
} else sq_pushnull(vm);
|
||||||
|
}
|
||||||
|
|
||||||
static void PushInstance(HSQUIRRELVM vm, C* ptr) {
|
static void PushInstance(HSQUIRRELVM vm, C* ptr) {
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
sq_pushnull(vm);
|
sq_pushnull(vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user