mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-15 22:12:32 +03:00
Fixing issue with restored vscript classes that are not registered being unable to be instantiated
This commit is contained in:
parent
859447ee69
commit
07eb28ffe8
@ -1674,11 +1674,19 @@ bool SquirrelVM::RegisterClass(ScriptClassDesc_t* pClassDesc)
|
|||||||
|
|
||||||
// Check if class name is already taken
|
// Check if class name is already taken
|
||||||
if (sq_get(vm_, -2) == SQ_OK)
|
if (sq_get(vm_, -2) == SQ_OK)
|
||||||
|
{
|
||||||
|
HSQOBJECT obj;
|
||||||
|
sq_resetobject(&obj);
|
||||||
|
sq_getstackobj(vm_, -1, &obj);
|
||||||
|
if (!sq_isnull(obj))
|
||||||
{
|
{
|
||||||
sq_pop(vm_, 2);
|
sq_pop(vm_, 2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sq_pop(vm_, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Register base in case it doesn't exist
|
// Register base in case it doesn't exist
|
||||||
if (pClassDesc->m_pBaseDesc)
|
if (pClassDesc->m_pBaseDesc)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user