Skip to content

Commit

Permalink
fix(Core/Gameobject): prevent getting empty fishing loot (#21216)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudlud authored Jan 19, 2025
1 parent b238daa commit c72ac10
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/server/game/Entities/GameObject/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,12 +1011,15 @@ void GameObject::GetFishLoot(Loot* fishloot, Player* loot_owner)

// if subzone loot exist use it
fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner, true, true);
if (fishloot->empty()) //use this becase if zone or subzone has set LOOT_MODE_JUNK_FISH,Even if no normal drop, fishloot->FillLoot return true. it wrong.

// isLooted() returns true here if player is e.g. not eligible for any loot due to conditions
if (fishloot->empty() || fishloot->isLooted()) //use this becase if zone or subzone has set LOOT_MODE_JUNK_FISH,Even if no normal drop, fishloot->FillLoot return true. it wrong.
{
//subzone no result,use zone loot
fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner, true, true);
//use zone 1 as default, somewhere fishing got nothing,becase subzone and zone not set, like Off the coast of Storm Peaks.
if (fishloot->empty())
// isLooted() returns true here if player is e.g. not eligible for any loot due to conditions
if (fishloot->empty() || fishloot->isLooted())
fishloot->FillLoot(defaultzone, LootTemplates_Fishing, loot_owner, true, true);
}
}
Expand All @@ -1031,11 +1034,15 @@ void GameObject::GetFishLootJunk(Loot* fishloot, Player* loot_owner)

// if subzone loot exist use it
fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner, true, true, LOOT_MODE_JUNK_FISH);
if (fishloot->empty()) //use this becase if zone or subzone has normal mask drop, then fishloot->FillLoot return true.

// isLooted() returns true here if player is e.g. not eligible for any loot due to conditions
if (fishloot->empty() || fishloot->isLooted()) //use this becase if zone or subzone has normal mask drop, then fishloot->FillLoot return true.
{
//use zone loot
fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner, true, true, LOOT_MODE_JUNK_FISH);
if (fishloot->empty())

// isLooted() returns true here if player is e.g. not eligible for any loot due to conditions
if (fishloot->empty() || fishloot->isLooted())
//use zone 1 as default
fishloot->FillLoot(defaultzone, LootTemplates_Fishing, loot_owner, true, true, LOOT_MODE_JUNK_FISH);
}
Expand Down

0 comments on commit c72ac10

Please sign in to comment.