Minor code edits

This commit is contained in:
NovaRain
2021-06-01 09:51:59 +08:00
parent a9a8088775
commit b665c904f1
4 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -371,7 +371,7 @@ SingleCore=1
OverrideArtCacheSize=0 OverrideArtCacheSize=0
;Prevents you from saving in combat except at the start of your turn to avoid a few bugs ;Prevents you from saving in combat except at the start of your turn to avoid a few bugs
;Note that even with this option enabled, it is still not advisable to save in combat at all (obsolete information) ;Note that even with this option enabled, it is still not advisable to save in combat
;Set to 2 to block all saving in combat ;Set to 2 to block all saving in combat
SaveInCombatFix=1 SaveInCombatFix=1
+1 -1
View File
@@ -599,7 +599,7 @@ void AI::init() {
/////////////////////// Combat behavior AI fixes /////////////////////// /////////////////////// Combat behavior AI fixes ///////////////////////
#ifndef NDEBUG #ifndef NDEBUG
if (IniReader::GetIntDefaultConfig("Debugging", "AIBugFixes", 1) == 0) return; if (IniReader::GetIntDefaultConfig("Debugging", "AIFixes", 1) == 0) return;
#endif #endif
// Fix for NPCs not fully reloading a weapon if it has an ammo capacity more than a box of ammo // Fix for NPCs not fully reloading a weapon if it has an ammo capacity more than a box of ammo
+6
View File
@@ -3864,6 +3864,12 @@ void BugFixes::init()
}; };
SafeWriteBytes(0x42A0F4, codeData1, 18); // ai_move_steps_closer_ SafeWriteBytes(0x42A0F4, codeData1, 18); // ai_move_steps_closer_
HookCall(0x42A0F8, (void*)fo::funcoffs::obj_dist_); HookCall(0x42A0F8, (void*)fo::funcoffs::obj_dist_);
BYTE codeData2[] = { // swap code
0x90, 0x90, 0x31, 0xC0, // xor eax, eax
0xF6, 0x47, 0x25, 0x08, // test [edi + 0x25], MultiHex_
};
SafeWriteBytes(0x42A0E6, codeData2, 8); // ai_move_steps_closer_
SafeWrite8(0x42A0F2, CodeType::JumpZ); // jmp > jz
// Fix to prevent the execution of critter_p_proc and game events when playing movies (same as when the dialog is active) // Fix to prevent the execution of critter_p_proc and game events when playing movies (same as when the dialog is active)
HookCall(0x4A3C89, doBkProcesses_hook); HookCall(0x4A3C89, doBkProcesses_hook);
+2 -2
View File
@@ -313,7 +313,7 @@ hide:
} }
static void __declspec(naked) art_data_size_hook() { static void __declspec(naked) art_data_size_hook() {
static char* artDbgMsg = "\nERROR: File not found: %s\n"; static const char* artDbgMsg = "\nERROR: File not found: %s\n";
__asm { __asm {
test edi, edi; test edi, edi;
jz artNotExist; jz artNotExist;
@@ -340,7 +340,7 @@ display:
} }
static void __declspec(naked) proto_load_pid_hack() { static void __declspec(naked) proto_load_pid_hack() {
static const char* proDbgMsg = "\nERROR reading prototype file: %s\n"; static const char* proDbgMsg = "\nERROR: Reading prototype file: %s\n";
__asm { __asm {
mov dword ptr [esp + 0x120 - 0x1C + 4], -1; mov dword ptr [esp + 0x120 - 0x1C + 4], -1;
lea eax, [esp + 0x120 - 0x120 + 4]; // pro file lea eax, [esp + 0x120 - 0x120 + 4]; // pro file