mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Simplified the code of Haenlomal's MultiHexFix a bit.
This commit is contained in:
+5
-18
@@ -560,9 +560,8 @@ static void __declspec(naked) op_wield_obj_critter_adjust_ac_hook() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const DWORD MultiHexFix1End = 0x429024;
|
// Haenlomal
|
||||||
static const DWORD MultiHexFix2End = 0x429175;
|
static void __declspec(naked) MultiHexFix() {
|
||||||
static void __declspec(naked) MultiHexFix1() {
|
|
||||||
__asm {
|
__asm {
|
||||||
xor ecx, ecx; // argument value for make_path_func: ecx=0 (unknown arg)
|
xor ecx, ecx; // argument value for make_path_func: ecx=0 (unknown arg)
|
||||||
test byte ptr ds:[ebx+0x25], 0x08; // is target multihex?
|
test byte ptr ds:[ebx+0x25], 0x08; // is target multihex?
|
||||||
@@ -570,19 +569,7 @@ static void __declspec(naked) MultiHexFix1() {
|
|||||||
je end; // skip if not multihex
|
je end; // skip if not multihex
|
||||||
inc ebx; // otherwise, increase tilenum by 1
|
inc ebx; // otherwise, increase tilenum by 1
|
||||||
end:
|
end:
|
||||||
jmp MultiHexFix1End; // call make_path_func
|
retn; // call make_path_func (at 0x429024, 0x429175)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __declspec(naked) MultiHexFix2() {
|
|
||||||
__asm {
|
|
||||||
xor ecx,ecx; // argument for make_path_func: ecx=0 (unknown arg)
|
|
||||||
test byte ptr ds:[ebx+0x25],0x08; // is target multihex?
|
|
||||||
mov ebx,dword ptr ds:[ebx+0x4]; // argument for make_path_func: target's tilenum (end_tile)
|
|
||||||
je end; // skip if not multihex
|
|
||||||
inc ebx; // otherwise, increase tilenum by 1
|
|
||||||
end:
|
|
||||||
jmp MultiHexFix2End; // call make_path_func
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -867,8 +854,8 @@ void BugsInit()
|
|||||||
|
|
||||||
//if (GetPrivateProfileIntA("Misc", "MultiHexPathingFix", 1, ini)) {
|
//if (GetPrivateProfileIntA("Misc", "MultiHexPathingFix", 1, ini)) {
|
||||||
dlog("Applying MultiHex Pathing Fix.", DL_INIT);
|
dlog("Applying MultiHex Pathing Fix.", DL_INIT);
|
||||||
MakeCall(0x42901F, &MultiHexFix1, true);
|
MakeCall(0x42901F, &MultiHexFix, false);
|
||||||
MakeCall(0x429170, &MultiHexFix2, true);
|
MakeCall(0x429170, &MultiHexFix, false);
|
||||||
dlogr(" Done", DL_INIT);
|
dlogr(" Done", DL_INIT);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user