Minor code edits

This commit is contained in:
NovaRain
2021-06-01 09:53:04 +08:00
parent 3f001f2235
commit 493485724b
4 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -365,7 +365,7 @@ SingleCore=1
OverrideArtCacheSize=0
;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
SaveInCombatFix=1
+1 -1
View File
@@ -592,7 +592,7 @@ void AI_Init() {
/////////////////////// Combat behavior AI fixes ///////////////////////
#ifndef NDEBUG
if (GetIntDefaultConfig("Debugging", "AIBugFixes", 1) == 0) return;
if (GetIntDefaultConfig("Debugging", "AIFixes", 1) == 0) return;
#endif
// Fix for NPCs not fully reloading a weapon if it has an ammo capacity more than a box of ammo
+6
View File
@@ -3857,6 +3857,12 @@ void BugFixes_Init()
};
SafeWriteBytes(0x42A0F4, codeData1, 18); // ai_move_steps_closer_
HookCall(0x42A0F8, (void*)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)
HookCall(0x4A3C89, doBkProcesses_hook);
+2 -2
View File
@@ -310,7 +310,7 @@ hide:
}
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 {
test edi, edi;
jz artNotExist;
@@ -337,7 +337,7 @@ display:
}
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 {
mov dword ptr [esp + 0x120 - 0x1C + 4], -1;
lea eax, [esp + 0x120 - 0x120 + 4]; // pro file