mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed anim_move_to_tile_ ignoring the distance argument.
* this also fixes the broken "reserve movement" feature.
This commit is contained in:
@@ -2093,6 +2093,22 @@ dude:
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) anim_move_to_tile_hook() {
|
||||
__asm {
|
||||
push ebx;
|
||||
mov ebx, dword ptr [esp + 0x18 - 0x10 + 8]; // distance
|
||||
test ebx, ebx;
|
||||
jl skip; // dist < 0
|
||||
cmp ebx, [eax + movePoints];
|
||||
jge skip; // dist >= source.curr_mp
|
||||
pop ebx;
|
||||
retn;
|
||||
skip:
|
||||
pop ebx;
|
||||
jmp fo::funcoffs::obj_blocking_at_;
|
||||
}
|
||||
}
|
||||
|
||||
void BugFixes::init()
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
@@ -2652,6 +2668,9 @@ void BugFixes::init()
|
||||
// up an item due to not enough space in the inventory
|
||||
HookCall(0x49B6E7, obj_pickup_hook);
|
||||
HookCall(0x49B71C, obj_pickup_hook_message);
|
||||
|
||||
// Fix for anim_move_to_tile_ engine function ignoring the distance argument
|
||||
HookCall(0x416D44, anim_move_to_tile_hook);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ static bool restMode;
|
||||
static bool restTime;
|
||||
|
||||
static int mapSlotsScrollMax = 27 * (17 - 7);
|
||||
static int mapSlotsScrollLimit;
|
||||
static int mapSlotsScrollLimit = 0;
|
||||
|
||||
static DWORD worldMapDelay;
|
||||
static DWORD worldMapTicks;
|
||||
@@ -387,7 +387,7 @@ void WorldLimitsPatches() {
|
||||
if (wmSlots && wmSlots < 128) {
|
||||
dlog("Applying world map slots patch.", DL_INIT);
|
||||
if (wmSlots < 7) wmSlots = 7;
|
||||
mapSlotsScrollMax = (wmSlots - 7) * 27; // value of the height after which scrolling is not possible
|
||||
mapSlotsScrollMax = (wmSlots - 7) * 27; // height value after which scrolling is not possible
|
||||
mapSlotsScrollLimit = wmSlots * 27;
|
||||
SafeWrite32(0x4C21FD, 189); // 27 * 7
|
||||
SafeWrite32(0x4C21F1, (DWORD)&mapSlotsScrollLimit);
|
||||
|
||||
Reference in New Issue
Block a user