Fixed player's base EMP DR isn't properly initialized when creating a new character and then starting the game.

This commit is contained in:
NovaRain
2017-12-15 07:32:18 +08:00
parent 9b808cd008
commit d388a5c3bb
+8
View File
@@ -152,6 +152,13 @@ end:
}
}
static void __declspec(naked) SetPCBaseStatEMP() {
__asm {
mov ds:[29*4 + 0x51C394], 100; // set_pc_base_stat(STAT_dmg_resist_emp, 100)
retn;
}
}
// Called right before savegame slot is being loaded
static void _stdcall LoadGame_Before() {
onBeforeGameStart.invoke();
@@ -457,6 +464,7 @@ static void __declspec(naked) AutomapHook() {
}
void LoadGameHook::init() {
LoadGameHook::OnAfterGameStarted() += SetPCBaseStatEMP;
saveInCombatFix = GetConfigInt("Misc", "SaveInCombatFix", 1);
if (saveInCombatFix > 2) saveInCombatFix = 0;
saveFailMsg = Translate("sfall", "SaveInCombat", "Cannot save at this time");