update scenarioplayer hook

This commit is contained in:
Akash Mozumdar 2018-08-18 19:06:45 -04:00
parent f1a2beef4f
commit 715bf9feaa

View File

@ -11355,18 +11355,23 @@ bool InsertScenarioPlayerHook()
} }
HookParam hp = {}; HookParam hp = {};
hp.address = addr; //hp.address = addr;
hp.length_offset = 1; hp.length_offset = 1;
hp.offset = 4; hp.offset = 4;
if (addr - start == addr_offset_W) { //if (addr - start == addr_offset_W) {
hp.type = USING_UNICODE; // Artikash 8/18/2018: can't figure out how to tell apart which hook is needed, so just insert both xD
ConsoleOutput("vnreng: INSERT ScenarioPlayerW"); HookParam hp2 = hp;
NewHook(hp, "ScenarioPlayerW");
} else { hp.type = USING_UNICODE;
hp.type = BIG_ENDIAN; // 4 hp.address = addr;
ConsoleOutput("vnreng: INSERT ScenarioPlayerA"); ConsoleOutput("vnreng: INSERT ScenarioPlayerW");
NewHook(hp, "ScenarioPlayerA"); NewHook(hp, "ScenarioPlayerW");
} //} else {
hp2.type = BIG_ENDIAN; // 4
hp2.address = addr + 5;
ConsoleOutput("vnreng: INSERT ScenarioPlayerA");
NewHook(hp2, "ScenarioPlayerA");
//}
return true; return true;
} }