This commit is contained in:
luis
2026-09-23 10:11:42 -03:00
parent 14ba04a2c0
commit ae1c5f670f
+13 -5
View File
@@ -3304,17 +3304,25 @@ void ScriptMgr::OnQuestAbandon(Player* player, const Quest* quest)
void WowCommunity::PhaseShift(Player* player, std::vector<uint32> phaseIDs, bool add) void WowCommunity::PhaseShift(Player* player, std::vector<uint32> phaseIDs, bool add)
{ {
// Exile's Reach calls this every second. A false condition used to RemovePhase, // Exile's Reach calls this every second with the condition for that stage.
// which stripped phases the world database had already applied and hid the quest // A true condition adds the phase. A false condition removes only that phase,
// givers for the rest of the island. Only additions run here. A caller that must // so a later quest stage does not leave the previous NPCs visible.
// drop a phase uses PhasingHandler::RemovePhase itself. // Callers that must keep a phase (the general ship and the general shore)
if (!player || !add) // pass true. Phases this function never names are left untouched.
if (!player)
return; return;
for (uint32 phaseID : phaseIDs) for (uint32 phaseID : phaseIDs)
{
if (add)
{
if (!player->GetPhaseShift().HasPhase(phaseID)) if (!player->GetPhaseShift().HasPhase(phaseID))
PhasingHandler::AddPhase(player, phaseID, true); PhasingHandler::AddPhase(player, phaseID, true);
} }
else if (player->GetPhaseShift().HasPhase(phaseID))
PhasingHandler::RemovePhase(player, phaseID, true);
}
}
void ScriptMgr::OnPlayerWorldObjectUpdate(Player* player, uint32 diff) void ScriptMgr::OnPlayerWorldObjectUpdate(Player* player, uint32 diff)
{ {