mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added a new value to InstantWeaponEquip
Tweaked the animation sequence when interacting with scenery or using an item on an object.
This commit is contained in:
+2
-1
@@ -707,7 +707,8 @@ ActiveGeigerMsgs=1
|
||||
;Set to 1 to fix the bug of being unable to sell used geiger counters or stealth boys
|
||||
CanSellUsedGeiger=1
|
||||
|
||||
;Set to 1 to skip weapon equip/unequip animations when performing various actions
|
||||
;Set to 1 to skip weapon equip/unequip animations during various actions
|
||||
;Set to 2 to skip these animations only when interacting with objects
|
||||
InstantWeaponEquip=0
|
||||
|
||||
;To add additional game msg files, uncomment the next line and set a comma-delimited list of filenames without .msg extension
|
||||
|
||||
@@ -471,6 +471,13 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
static __declspec(naked) void action_use_an_item_on_object_hook() {
|
||||
__asm {
|
||||
dec ebx; // set delay to -1
|
||||
jmp fo::funcoffs::register_object_animate_;
|
||||
}
|
||||
}
|
||||
|
||||
static __declspec(naked) void art_alias_fid_hack() {
|
||||
static const DWORD art_alias_fid_Ret = 0x419A6D;
|
||||
using namespace fo;
|
||||
@@ -663,12 +670,16 @@ 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);
|
||||
|
||||
// Allow playing the "magic hands" animation when using an item on an object
|
||||
SafeWrite16(0x4120B8, 0x9090); // action_use_an_item_on_object_
|
||||
// Change the animation sequence to be in line with action_get_an_object_
|
||||
// ANIM_put_away animation only plays for "stairs" type scenery (SFX only for all other cases)
|
||||
HookCall(0x41206D, action_use_an_item_on_object_hook);
|
||||
SafeWrite32(0x4120BB, 0); // delay for "magic hands" animation
|
||||
|
||||
// Add ANIM_charred_body/ANIM_charred_body_sf animations to art aliases
|
||||
MakeCall(0x419A17, art_alias_fid_hack);
|
||||
|
||||
|
||||
@@ -608,19 +608,32 @@ static void InstantWeaponEquipPatch() {
|
||||
const DWORD PutAwayWeapon[] = {
|
||||
0x411EA2, // action_climb_ladder_
|
||||
0x412046, // action_use_an_item_on_object_
|
||||
0x41224A, // action_get_an_object_
|
||||
0x41224A // action_get_an_object_
|
||||
};
|
||||
const DWORD PutAwayWeaponExtra[] = {
|
||||
0x4606A5, // intface_change_fid_animate_
|
||||
0x472996, // invenWieldFunc_
|
||||
0x472996 // invenWieldFunc_
|
||||
};
|
||||
|
||||
if (IniReader::GetConfigInt("Misc", "InstantWeaponEquip", 0)) {
|
||||
//Skip weapon equip/unequip animations
|
||||
int skipAnims = IniReader::GetConfigInt("Misc", "InstantWeaponEquip", 0);
|
||||
if (skipAnims) {
|
||||
// Skip weapon equip/unequip animations
|
||||
dlogr("Applying instant weapon equip patch.", DL_INIT);
|
||||
SafeWriteBatch<BYTE>(CodeType::JumpShort, PutAwayWeapon); // jmps
|
||||
BlockCall(0x472AD5); //
|
||||
BlockCall(0x472AE0); // invenUnwieldFunc_
|
||||
BlockCall(0x472AF0); //
|
||||
MakeJump(0x415238, register_object_take_out_hack);
|
||||
SafeWriteBatch<BYTE>(CodeType::JumpShort, PutAwayWeapon);
|
||||
if (skipAnims == 1) {
|
||||
SafeWriteBatch<BYTE>(CodeType::JumpShort, PutAwayWeaponExtra);
|
||||
BlockCall(0x472AD5); //
|
||||
BlockCall(0x472AE0); // invenUnwieldFunc_
|
||||
BlockCall(0x472AF0); //
|
||||
MakeJump(0x415238, register_object_take_out_hack);
|
||||
} else {
|
||||
const DWORD TakeOutWeapon[] = {
|
||||
0x411F18, // action_climb_ladder_
|
||||
0x412102, // action_use_an_item_on_object_
|
||||
0x4122FA // action_get_an_object_
|
||||
};
|
||||
HookCalls(register_object_take_out_hack, TakeOutWeapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user