Core/GameObjects: Fix crash with FishingHole gameobjects that have minSuccessOpens > maxSuccessOpens in gameobject_template (#31718)

(cherry picked from commit d21f6dd48d6bcab9c45e19f30bae0bc7c40ad5de)
This commit is contained in:
offl
2026-06-30 16:42:16 +02:00
committed by Shauren
parent a21057e5a8
commit 59c55eccde
@@ -1087,7 +1087,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
{
case GAMEOBJECT_TYPE_FISHINGHOLE:
SetGoAnimProgress(animProgress);
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishingHole.minRestock, GetGOInfo()->fishingHole.maxRestock);
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishingHole.minRestock, std::max(GetGOInfo()->fishingHole.minRestock, GetGOInfo()->fishingHole.maxRestock));
break;
case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
{
@@ -1443,7 +1443,7 @@ void GameObject::Update(uint32 diff)
break;
case GAMEOBJECT_TYPE_FISHINGHOLE:
// Initialize a new max fish count on respawn
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishingHole.minRestock, GetGOInfo()->fishingHole.maxRestock);
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishingHole.minRestock, std::max(GetGOInfo()->fishingHole.minRestock, GetGOInfo()->fishingHole.maxRestock));
break;
default:
break;