Core/GameObjects: Fixed the behavior for GAMEOBJECT_TYPE_FISHINGNODE (#28781)

This commit is contained in:
Meji
2023-02-05 15:16:19 +01:00
committed by GitHub
parent bb8f713d5f
commit 56d0f7a970
2 changed files with 14 additions and 14 deletions

View File

@@ -770,7 +770,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
break;
}
case GAMEOBJECT_TYPE_FISHINGNODE:
SetLevel(1);
SetLevel(0);
SetGoAnimProgress(255);
break;
case GAMEOBJECT_TYPE_TRAP:
@@ -971,18 +971,7 @@ void GameObject::Update(uint32 diff)
// splash bobber (bobber ready now)
Unit* caster = GetOwner();
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
{
SetGoState(GO_STATE_ACTIVE);
ReplaceAllFlags(GO_FLAG_NODESPAWN);
UpdateData udata(caster->GetMapId());
WorldPacket packet;
BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer());
udata.BuildPacket(&packet);
caster->ToPlayer()->SendDirectMessage(&packet);
SendCustomAnim(GetGoAnimProgress());
}
SendCustomAnim(0);
m_lootState = GO_READY; // can be successfully open with some chance
}
@@ -2521,6 +2510,13 @@ void GameObject::Use(Unit* user)
{
case GO_READY: // ready for loot
{
SetLootState(GO_ACTIVATED, player);
SetGoState(GO_STATE_ACTIVE);
ReplaceAllFlags(GO_FLAG_IN_MULTI_USE);
SendUpdateToPlayer(player);
uint32 zone, subzone;
GetZoneAndAreaId(zone, subzone);

View File

@@ -288,7 +288,11 @@ void WorldSession::DoLootRelease(Loot* loot)
if (loot->isLooted() || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
{
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE)
{
go->SetLootState(GO_JUST_DEACTIVATED);
}
else if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
{ // The fishing hole used once more
go->AddUse(); // if the max usage is reached, will be despawned in next tick
if (go->GetUseCount() >= go->GetGOValue()->FishingHole.MaxOpens)