Fix crash when opening bag on the bartering table

This commit is contained in:
Alexander Batalov 2022-08-19 19:54:39 +03:00
parent 3878be0d09
commit b89d6dfd72
1 changed files with 5 additions and 2 deletions

View File

@ -3358,8 +3358,11 @@ static void inventoryWindowOpenContextMenu(int keyCode, int inventoryWindowType)
} }
} else { } else {
if (inventoryWindowType != INVENTORY_WINDOW_TYPE_NORMAL) { if (inventoryWindowType != INVENTORY_WINDOW_TYPE_NORMAL) {
if (objectGetOwner(item) != gDude) { // SFALL: Fix crash when trying to open bag/backpack on the table
if (itemType == ITEM_TYPE_CONTAINER) { // in the bartering interface.
Object* owner = objectGetOwner(item);
if (owner != gDude) {
if (itemType == ITEM_TYPE_CONTAINER && (owner == _stack[_curr_stack] || owner == _target_stack[_target_curr_stack])) {
actionMenuItemsLength = 3; actionMenuItemsLength = 3;
actionMenuItems = _act_just_use; actionMenuItems = _act_just_use;
} else { } else {