Add replaceFunc function

This commit is contained in:
Federico Cecchetto
2021-05-29 23:35:47 +02:00
parent a58e8c95b6
commit b38e50d520
3 changed files with 79 additions and 0 deletions

View File

@ -12,6 +12,8 @@ namespace scripting
std::unordered_map<int, std::unordered_map<std::string, int>> fields_table;
std::unordered_map<std::string, std::unordered_map<std::string, char*>> script_function_table;
std::unordered_map<unsigned, unsigned> replaced_functions;
namespace
{
utils::hook::detour vm_notify_hook;
@ -67,6 +69,8 @@ namespace scripting
void g_shutdown_game_stub(const int free_scripts)
{
replaced_functions.clear();
g_shutdown_game_hook.invoke<void>(free_scripts);
}