fix(Scripts/CoS): Fix chest despawning when player leaves map (#23112)

This commit is contained in:
Andrew
2025-10-07 04:37:40 -03:00
committed by GitHub
parent 10acbafed5
commit 939dae3119

View File

@@ -1154,16 +1154,7 @@ public:
if (GameObject* go = pInstance->instance->GetGameObject(pInstance->GetGuidData(DATA_EXIT_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
if (!me->GetMap()->GetPlayers().IsEmpty())
{
if (Player* player = me->GetMap()->GetPlayers().getFirst()->GetSource())
{
if (GameObject* chest = player->SummonGameObject(DUNGEON_MODE(GO_MALGANIS_CHEST_N, GO_MALGANIS_CHEST_H), 2288.35f, 1498.73f, 128.414f, -0.994837f, 0, 0, 0, 0, 0))
{
chest->SetLootRecipient(me->GetMap());
}
}
}
pInstance->instance->SummonGameObject(DUNGEON_MODE(GO_MALGANIS_CHEST_N, GO_MALGANIS_CHEST_H), 2288.35f, 1498.73f, 128.414f, -0.994837f, 0, 0, 0, 0, 7 * DAY * IN_MILLISECONDS);
}
ScheduleNextEvent(currentEvent, 10000);
break;