Fix script patches crashing game on unload (#590)
This commit is contained in:
@ -51,6 +51,16 @@ namespace big
|
||||
p.update(data);
|
||||
}
|
||||
|
||||
script_patcher_service::script_patcher_service()
|
||||
{
|
||||
g_script_patcher_service = this;
|
||||
}
|
||||
|
||||
script_patcher_service::~script_patcher_service()
|
||||
{
|
||||
g_script_patcher_service = nullptr;
|
||||
}
|
||||
|
||||
void script_patcher_service::add_patch(script_patch&& patch)
|
||||
{
|
||||
m_script_patches.push_back(std::move(patch));
|
||||
|
@ -16,11 +16,14 @@ namespace big
|
||||
void update_all_patches_for_script(rage::joaat_t script);
|
||||
|
||||
public:
|
||||
script_patcher_service();
|
||||
~script_patcher_service();
|
||||
|
||||
void add_patch(script_patch&& patch);
|
||||
void on_script_load(rage::scrProgram* program);
|
||||
std::uint8_t** get_script_bytecode(rage::joaat_t script);
|
||||
void update();
|
||||
};
|
||||
|
||||
inline script_patcher_service g_script_patcher_service;
|
||||
inline script_patcher_service* g_script_patcher_service;
|
||||
}
|
Reference in New Issue
Block a user