Fix script patches crashing game on unload (#590)

This commit is contained in:
maybegreat48
2022-11-12 21:02:50 +00:00
committed by GitHub
parent ade733e4a0
commit ddc70a76e0
8 changed files with 26 additions and 8 deletions

View File

@ -9,7 +9,7 @@ namespace big
{
uint8_t** orig_bytecode = program->m_code_blocks;
if (auto bytecode = g_script_patcher_service.get_script_bytecode(program->m_name_hash))
if (auto bytecode = g_script_patcher_service->get_script_bytecode(program->m_name_hash); bytecode && g_running)
program->m_code_blocks = bytecode;
auto ret = g_hooking->get_original<hooks::script_vm>()(start_stack, scr_globals, program, ctx);