Skip to content

Commit 8336128

Browse files
authored
Core/GameObject: Fishing holes with zero min and max success opens should not despawn (#31719)
1 parent 009e146 commit 8336128

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/server/game/Handlers/LootHandler.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,18 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
282282
else if (loot->isLooted() || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE)
283283
{
284284
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
285-
{ // The fishing hole used once more
286-
go->AddUse(); // if the max usage is reached, will be despawned in next tick
287-
if (go->GetUseCount() >= go->GetGOValue()->FishingHole.MaxOpens)
288-
go->SetLootState(GO_JUST_DEACTIVATED);
289-
else
290-
go->SetLootState(GO_READY);
285+
{
286+
bool allOpensConsumed = false;
287+
if (go->GetGOValue()->FishingHole.MaxOpens)
288+
{
289+
// The fishing hole used once more
290+
go->AddUse();
291+
292+
// If the max usage is reached, will be despawned in next tick
293+
allOpensConsumed = go->GetUseCount() >= go->GetGOValue()->FishingHole.MaxOpens;
294+
}
295+
296+
go->SetLootState(allOpensConsumed ? GO_JUST_DEACTIVATED : GO_READY);
291297
}
292298
else
293299
go->SetLootState(GO_JUST_DEACTIVATED);

0 commit comments

Comments
 (0)