mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed a crash when trying to open bag/backpack on the table in the bartering interface (from Crafty)
Added a tweak to move items to player's main inventory instead of the opened bag/backpack when confirming a trade.
This commit is contained in:
@@ -915,6 +915,18 @@ end:
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) inven_action_cursor_hack() {
|
||||
__asm {
|
||||
cmp dword ptr [esp+0x44+0x4], item_type_container
|
||||
jne end
|
||||
cmp eax, ds:[_stack]
|
||||
je end
|
||||
cmp eax, ds:[_target_stack]
|
||||
end:
|
||||
retn
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BugsInit()
|
||||
{
|
||||
@@ -1171,5 +1183,7 @@ void BugsInit()
|
||||
SafeWrite8(0x471BD0, 0x90); // nop
|
||||
MakeCall(0x471C17, &inven_item_wearing, false); // inven_worn_
|
||||
SafeWrite8(0x471C1C, 0x90); // nop
|
||||
// Fix crash when trying to open bag/backpack on the table in the bartering interface
|
||||
MakeCall(0x473191, &inven_action_cursor_hack, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,6 +684,9 @@ void InventoryInit() {
|
||||
// Move items out of bag/backpack and back into the main inventory list by dragging them to character's image
|
||||
// (similar to Fallout 1 behavior)
|
||||
HookCall(0x471457, &inven_pickup_hook);
|
||||
|
||||
// Move items to player's main inventory instead of the opened bag/backpack when confirming a trade
|
||||
SafeWrite32(0x475CF2, _stack);
|
||||
}
|
||||
|
||||
void InventoryReset() {
|
||||
|
||||
Reference in New Issue
Block a user