From 6d88f2102857fe21b1abcf1f8939cab1787fd2cf Mon Sep 17 00:00:00 2001 From: NovaRain Date: Fri, 7 May 2021 15:48:40 +0800 Subject: [PATCH] Added a tweak to play "magic hands" anim when using items on objs * for issues with scripted animations not playing (#356) --- artifacts/ddraw.ini | 2 +- sfall/Modules/Animations.cpp | 3 +++ sfall/Modules/ScriptExtender.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index c6c407ce9..2f1d4551f 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -421,7 +421,7 @@ CorpseDeleteTime=6 ;Set a number of milliseconds to idle each input loop ;Set to -1 to disable ;Set to 0 to idle only if other processes are waiting for processor time (WinXP/2000: if processes have equal priority) -;Set to 1 (or some higher number if needed) to prevent 100% CPU use. The maximum is 100 +;Set to 1 (or some higher number if needed) to prevent 100% CPU use. The maximum is 30 ProcessorIdle=-1 ;Set to 1 if using the hero appearance mod diff --git a/sfall/Modules/Animations.cpp b/sfall/Modules/Animations.cpp index 05f49480e..fb48f20a9 100644 --- a/sfall/Modules/Animations.cpp +++ b/sfall/Modules/Animations.cpp @@ -358,6 +358,9 @@ void Animations::init() { // Fix crash when the critter goes through a door with animation trigger MakeJump(0x41755E, object_move_hack); + // Allow playing the "magic hands" animation when using an item on an object + SafeWrite16(0x4120B8, 0x9090); // action_use_an_item_on_object_ + // Fix for the player stuck at "climbing" frame after ladder climbing animation HookCall(0x411E1F, action_climb_ladder_hook); diff --git a/sfall/Modules/ScriptExtender.cpp b/sfall/Modules/ScriptExtender.cpp index 953552788..851c9657d 100644 --- a/sfall/Modules/ScriptExtender.cpp +++ b/sfall/Modules/ScriptExtender.cpp @@ -940,7 +940,7 @@ void ScriptExtender::init() { } idle = IniReader::GetConfigInt("Misc", "ProcessorIdle", -1); - if (idle > -1 && idle > 100) idle = 100; + if (idle > -1 && idle > 30) idle = 30; arraysBehavior = IniReader::GetConfigInt("Misc", "arraysBehavior", 1); if (arraysBehavior > 0) {