diff --git a/sfall/BugFixes.cpp b/sfall/BugFixes.cpp index 0f805a91..2ab8f7dd 100644 --- a/sfall/BugFixes.cpp +++ b/sfall/BugFixes.cpp @@ -2082,6 +2082,14 @@ skip: } } +static void __declspec(naked) action_use_an_item_on_object_hack() { + __asm { + add ebx, ds:[_combat_free_move]; + mov eax, 2; // RB_RESERVED + retn; + } +} + void BugFixesInit() { #ifndef NDEBUG @@ -2631,6 +2639,9 @@ void BugFixesInit() HookCall(0x49B6E7, obj_pickup_hook); HookCall(0x49B71C, obj_pickup_hook_message); - // Fix for anim_move_to_tile_ engine function ignoring the distance argument + // Fix for anim_move_to_tile_ engine function ignoring the distance argument (when moving critters) HookCall(0x416D44, anim_move_to_tile_hook); + + // Fix for the player's movement in combat being interrupted when trying to use objects with Bonus Move APs available + MakeCall(0x411FD6, action_use_an_item_on_object_hack); } diff --git a/sfall/HeroAppearance.cpp b/sfall/HeroAppearance.cpp index 9593252b..d9a48a03 100644 --- a/sfall/HeroAppearance.cpp +++ b/sfall/HeroAppearance.cpp @@ -769,8 +769,8 @@ void _stdcall RefreshHeroBaseArt() { } /* -// Check fallout paths for file -long __stdcall db_file_exist(const char *fileName, DWORD *sizeOut) { +// Check fallout file and get file size (result 0 - file exists) +long __stdcall db_dir_entry(const char *fileName, DWORD *sizeOut) { __asm { mov edx, sizeOut; mov eax, fileName; @@ -864,19 +864,16 @@ setPath: static void __declspec(naked) CheckHeroExist() { __asm { - cmp esi, critterArraySize; // check if loading hero art + cmp esi, critterArraySize; // check if loading hero art jle endFunc; - sub esp, 4; - lea edx, [esp]; // size out - mov eax, _art_name; // critter art file name address - call db_dir_entry_; // check art file exists - add esp, 4; - cmp eax, -1; - jne endFunc; + mov eax, _art_name; // critter art file name address (file name) + call db_access_; // check art file exists + test eax, eax; + jnz endFunc; // if file not found load regular critter art instead sub esi, critterArraySize; - add esp, 4; // drop func ret address + add esp, 4; // drop func ret address mov eax, 0x4194E2; jmp eax; endFunc: