mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
fix access violation on script command
running "script_client" from main menu would cause an access violation when attempting to access m_hVM from the CSquirrelVM instance for the client vm, which has not been created by this point
This commit is contained in:
parent
6ea1a8bebc
commit
5e58b7a5d3
@ -243,7 +243,15 @@ SQBool Script_LoadScript(HSQUIRRELVM v, const SQChar* szScriptPath, const SQChar
|
||||
//---------------------------------------------------------------------------------
|
||||
void Script_Execute(const SQChar* code, SQCONTEXT context)
|
||||
{
|
||||
HSQUIRRELVM v = Script_GetContextObject(context)->GetVM();
|
||||
CSquirrelVM* scriptVM = Script_GetContextObject(context);
|
||||
|
||||
if (!scriptVM)
|
||||
{
|
||||
Error(eDLL_T::ENGINE, "Attempted to run %s script while VM isn't initialized\n", SQVM_GetContextName(context));
|
||||
return;
|
||||
}
|
||||
|
||||
HSQUIRRELVM v = scriptVM->GetVM();
|
||||
if (!v)
|
||||
{
|
||||
Error(eDLL_T::ENGINE, "Attempted to run %s script while VM isn't initialized\n", SQVM_GetContextName(context));
|
||||
|
Loading…
x
Reference in New Issue
Block a user