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:
NovaRain
2017-02-21 01:43:29 +07:00
committed by phobos2077
parent 212118ba8c
commit 2d726de3f0
2 changed files with 17 additions and 0 deletions
+14
View File
@@ -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);
}
}
+3
View File
@@ -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() {