mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-27 07:15:31 +03:00
Adding IsValid to vscript
This commit is contained in:
parent
5b2547a6ff
commit
e9cbcd173d
@ -1067,6 +1067,14 @@ SQInteger tostring_stub(HSQUIRRELVM vm)
|
||||
return 1;
|
||||
}
|
||||
|
||||
SQInteger IsValid_stub(HSQUIRRELVM vm)
|
||||
{
|
||||
ClassInstanceData* classInstanceData = nullptr;
|
||||
sq_getinstanceup(vm, 1, (SQUserPointer*)&classInstanceData, 0);
|
||||
sq_pushbool(vm, classInstanceData == nullptr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct SquirrelSafeCheck
|
||||
{
|
||||
SquirrelSafeCheck(HSQUIRRELVM vm, int outputCount = 0) :
|
||||
@ -1719,6 +1727,10 @@ bool SquirrelVM::RegisterClass(ScriptClassDesc_t* pClassDesc)
|
||||
sq_newclosure(vm_, tostring_stub, 0);
|
||||
sq_newslot(vm_, -3, SQFalse);
|
||||
|
||||
sq_pushstring(vm_, "IsValid", -1);
|
||||
sq_newclosure(vm_, IsValid_stub, 0);
|
||||
sq_newslot(vm_, -3, SQFalse);
|
||||
|
||||
|
||||
for (int i = 0; i < pClassDesc->m_FunctionBindings.Count(); ++i)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user