Skip to content

Commit

Permalink
Update Source/inv.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Apr 20, 2024
1 parent abf8b84 commit 2a04009
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/inv.cpp
Expand Up @@ -569,9 +569,10 @@ void CheckInvPaste(Player &player, Point cursorPosition)
return;
}

auto const maybe_item_id = (il == ILOC_UNEQUIPABLE) ? GetPrevItemId(slot, player, itemSize) : 0;
if ((il == ILOC_UNEQUIPABLE) && !maybe_item_id) {
return;
std::optional<int8_t> maybe_item_id = 0;
if (il == ILOC_UNEQUIPABLE) {
maybe_item_id = GetPrevItemId(slot, player, itemSize);
if (!maybe_item_id) return;
}

if (IsNoneOf(il, ILOC_UNEQUIPABLE, ILOC_BELT) && !player.CanUseItem(player.HoldItem)) {
Expand Down

0 comments on commit 2a04009

Please sign in to comment.