diff options
Diffstat (limited to 'NorthstarDedicatedTest')
-rw-r--r-- | NorthstarDedicatedTest/squirrel.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/squirrel.h b/NorthstarDedicatedTest/squirrel.h index b01618f2..7801ada7 100644 --- a/NorthstarDedicatedTest/squirrel.h +++ b/NorthstarDedicatedTest/squirrel.h @@ -205,14 +205,20 @@ template <ScriptContext context> class SquirrelManager ClientSq_pushroottable(sqvm2); ClientSq_pushstring(sqvm2, funcname, -1); result = ClientSq_sq_get(sqvm2, -2); - ClientSq_pushroottable(sqvm2); + if (result != SQRESULT_ERROR) + { + ClientSq_pushroottable(sqvm2); + } } else if (context == ScriptContext::SERVER) { ServerSq_pushroottable(sqvm2); ServerSq_pushstring(sqvm2, funcname, -1); result = ServerSq_sq_get(sqvm2, -2); - ServerSq_pushroottable(sqvm2); + if (result != SQRESULT_ERROR) + { + ServerSq_pushroottable(sqvm2); + } } return result; } @@ -282,4 +288,4 @@ template <ScriptContext context> class SquirrelManager extern SquirrelManager<ScriptContext::CLIENT>* g_ClientSquirrelManager; extern SquirrelManager<ScriptContext::SERVER>* g_ServerSquirrelManager; -extern SquirrelManager<ScriptContext::UI>* g_UISquirrelManager;
\ No newline at end of file +extern SquirrelManager<ScriptContext::UI>* g_UISquirrelManager; |