Merge pull request #69 from ReDucTor/vscript-fix-vector-in-table

Vscript fix vector in table
This commit is contained in:
Blixibon 2020-12-13 11:33:11 -06:00 committed by GitHub
commit 6d45d9591e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1579,8 +1579,6 @@ struct ScriptHook_t
{ {
extern IScriptVM *g_pScriptVM; extern IScriptVM *g_pScriptVM;
Assert( ARRAYSIZE(pArgs) == m_desc.m_Parameters.Count() );
// Make sure we have a function in this scope // Make sure we have a function in this scope
if (!m_hFunc && !CanRunInScope(hScope)) if (!m_hFunc && !CanRunInScope(hScope))
return false; return false;
@ -1638,6 +1636,7 @@ public:
if ( !m_hScriptFunc_##FuncName.IsNull() ) \ if ( !m_hScriptFunc_##FuncName.IsNull() ) \
{ \ { \
ScriptVariant_t returnVal; \ ScriptVariant_t returnVal; \
Assert( N == m_desc.m_Parameters.Count() ); \
ScriptStatus_t result = Call( m_hScriptFunc_##FuncName.hFunction, &returnVal, FUNC_CALL_ARGS_##N ); \ ScriptStatus_t result = Call( m_hScriptFunc_##FuncName.hFunction, &returnVal, FUNC_CALL_ARGS_##N ); \
if ( result != SCRIPT_ERROR ) \ if ( result != SCRIPT_ERROR ) \
{ \ { \
@ -1662,6 +1661,7 @@ public:
\ \
if ( !m_hScriptFunc_##FuncName.IsNull() ) \ if ( !m_hScriptFunc_##FuncName.IsNull() ) \
{ \ { \
Assert( N == m_desc.m_Parameters.Count() ); \
ScriptStatus_t result = Call( m_hScriptFunc_##FuncName.hFunction, NULL, FUNC_CALL_ARGS_##N ); \ ScriptStatus_t result = Call( m_hScriptFunc_##FuncName.hFunction, NULL, FUNC_CALL_ARGS_##N ); \
if ( result != SCRIPT_ERROR ) \ if ( result != SCRIPT_ERROR ) \
{ \ { \

View File

@ -3182,6 +3182,8 @@ void SquirrelVM::ReadObject(CUtlBuffer* pBuffer, ReadStateMap& readState)
if (classType == VectorClassType) if (classType == VectorClassType)
{ {
sq_pushobject(vm_, vectorClass_); sq_pushobject(vm_, vectorClass_);
sq_getstackobj(vm_, -1, obj);
sq_addref(vm_, obj);
} }
else if (classType == NativeClassType) else if (classType == NativeClassType)
{ {