Skip to content

Commit

Permalink
Merge pull request #74 from ArchangelWTF/fix/return-quest-item-if-active
Browse files Browse the repository at this point in the history
Check if quest item is Active and Enabled
  • Loading branch information
Lacyway authored Jun 22, 2024
2 parents b5e6a47 + 7142f77 commit 1ae6f04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Fika.Core/Coop/Players/CoopPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1555,13 +1555,13 @@ public Item FindItem(string itemId, bool questItem = false)
{
if (lootItem is LootItem observedLootItem)
{
if (observedLootItem.Item.TemplateId == itemId)
if (observedLootItem.Item.TemplateId == itemId && observedLootItem.isActiveAndEnabled)
{
return observedLootItem.Item;
}
}
}
FikaPlugin.Instance.FikaLogger.LogError($"CoopPlayer::FindItem: Could not find questItem with id '{itemId}' in the world at all.");
FikaPlugin.Instance.FikaLogger.LogInfo($"CoopPlayer::FindItem: Could not find questItem with id '{itemId}' in the current session, either the quest is not active or something else occured.");
return null;
}

Expand Down

0 comments on commit 1ae6f04

Please sign in to comment.