mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Minor edits to combat_begin_anim_stop_hook
This commit is contained in:
@@ -514,22 +514,21 @@ notDude:
|
|||||||
|
|
||||||
static void __fastcall StopAnimationAtCombatStart() {
|
static void __fastcall StopAnimationAtCombatStart() {
|
||||||
fo::var::anim_in_anim_stop = true;
|
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];
|
const fo::AnimationSet& set = animSet[i];
|
||||||
if (set.currentAnim >= 1 && set.animations[set.currentAnim - 1].animType == fo::ANIM_TYPE_ANIMATE_FOREVER) continue;
|
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();
|
fo::func::object_anim_compact();
|
||||||
}
|
}
|
||||||
|
|
||||||
static __declspec(naked) void combat_begin_anim_stop_hook() {
|
static __declspec(naked) void combat_begin_anim_stop_hook() {
|
||||||
__asm {
|
__asm {
|
||||||
call StopAnimationAtCombatStart;
|
jmp StopAnimationAtCombatStart;
|
||||||
retn;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -643,6 +642,7 @@ void Animations::init() {
|
|||||||
SafeWrite16(0x4122D9, 0x9090); // action_get_an_object_
|
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);
|
HookCall(0x421A48, combat_begin_anim_stop_hook);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user