diff --git a/sfall/Modules/Animations.cpp b/sfall/Modules/Animations.cpp index b7de99a35..602eb0ee6 100644 --- a/sfall/Modules/Animations.cpp +++ b/sfall/Modules/Animations.cpp @@ -514,22 +514,21 @@ static __declspec(naked) void obj_use_container_hook() { static void __fastcall StopAnimationAtCombatStart() { fo::var::anim_in_anim_stop = true; - fo::var::curr_anim_set = -1; + fo::var::curr_anim_set = -1; - for (int i = 0; i < animationLimit; i++) { + for (int i = 0; i < animationLimit; i++) { const fo::AnimationSet& set = animSet[i]; if (set.currentAnim >= 1 && set.animations[set.currentAnim - 1].animType == fo::ANIM_TYPE_ANIMATE_FOREVER) continue; - fo::func::anim_set_end(i); - } + fo::func::anim_set_end(i); + } - fo::var::anim_in_anim_stop = false; + fo::var::anim_in_anim_stop = false; fo::func::object_anim_compact(); } static __declspec(naked) void combat_begin_anim_stop_hook() { __asm { - call StopAnimationAtCombatStart; - retn; + jmp StopAnimationAtCombatStart; } } @@ -643,6 +642,7 @@ void Animations::init() { SafeWrite16(0x4122D9, 0x9090); // action_get_an_object_ } + // Prevent the "forever" type of animation on objects from stopping when entering combat HookCall(0x421A48, combat_begin_anim_stop_hook); }