Skip to content

Commit

Permalink
Merge pull request #2481 from stellargames/t5936-allow_items_to_handl…
Browse files Browse the repository at this point in the history
…e_use_themselves_always

Always allow custom items to handle UseItem themselves.
  • Loading branch information
Interkarma committed Jan 17, 2023
2 parents c3a78a1 + e7f059e commit 53a682d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,10 @@ Item GetQuestItem(DaggerfallUnityItem item)
// This will need more work as more usable items are available
protected void UseItem(DaggerfallUnityItem item, ItemCollection collection = null)
{
// Allow item to handle its own use.
if (item.UseItem(collection))
return;

const int noSpellsTextId = 12;

// Handle quest items on use clicks
Expand Down Expand Up @@ -1977,9 +1981,7 @@ protected virtual void LocalItemListScroller_OnItemClick(DaggerfallUnityItem ite
}
else if (actionMode == ActionModes.Use)
{
// Allow item to handle its own use, fall through to general use function if unhandled
if (!item.UseItem(localItems))
UseItem(item, localItems);
UseItem(item, localItems);
Refresh(false);
}
else if (actionMode == ActionModes.Remove)
Expand Down Expand Up @@ -2041,9 +2043,7 @@ protected virtual void RemoteItemListScroller_OnItemClick(DaggerfallUnityItem it
}
else if (actionMode == ActionModes.Use)
{
// Allow item to handle its own use, fall through to general use function if unhandled
if (!item.UseItem(remoteItems))
UseItem(item, remoteItems);
UseItem(item, remoteItems);
Refresh(false);
}
else if (actionMode == ActionModes.Remove)
Expand Down

0 comments on commit 53a682d

Please sign in to comment.