Core/DungeonFinder:
- Corrections to c6c23b7f7e: Properly fixed #6748 after misunderstanding the issue.
- Display proper error message when teleportating as fatigued
This commit is contained in:
@@ -1431,6 +1431,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
|||||||
Group* group = player->GetGroup();
|
Group* group = player->GetGroup();
|
||||||
if (sendUpdate)
|
if (sendUpdate)
|
||||||
player->GetSession()->SendLfgUpdateProposal(proposalId, pProposal);
|
player->GetSession()->SendLfgUpdateProposal(proposalId, pProposal);
|
||||||
|
|
||||||
if (group)
|
if (group)
|
||||||
{
|
{
|
||||||
player->GetSession()->SendLfgUpdateParty(updateData);
|
player->GetSession()->SendLfgUpdateParty(updateData);
|
||||||
@@ -1482,6 +1483,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_teleport.push_back(pguid);
|
m_teleport.push_back(pguid);
|
||||||
grp->SetLfgRoles(pguid, pProposal->players[pguid]->role);
|
grp->SetLfgRoles(pguid, pProposal->players[pguid]->role);
|
||||||
SetState(pguid, LFG_STATE_DUNGEON);
|
SetState(pguid, LFG_STATE_DUNGEON);
|
||||||
@@ -1749,14 +1751,7 @@ void LFGMgr::UpdateBoot(Player* player, bool accept)
|
|||||||
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
|
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
|
||||||
{
|
{
|
||||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", player->GetGUID(), out ? "out" : "in");
|
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", player->GetGUID(), out ? "out" : "in");
|
||||||
if (out)
|
|
||||||
{
|
|
||||||
player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
|
|
||||||
player->TeleportToBGEntryPoint();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO Add support for LFG_TELEPORTERROR_FATIGUE
|
|
||||||
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
||||||
Group* grp = player->GetGroup();
|
Group* grp = player->GetGroup();
|
||||||
|
|
||||||
@@ -1766,13 +1761,25 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
|||||||
error = LFG_TELEPORTERROR_PLAYER_DEAD;
|
error = LFG_TELEPORTERROR_PLAYER_DEAD;
|
||||||
else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
|
else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
|
||||||
error = LFG_TELEPORTERROR_FALLING;
|
error = LFG_TELEPORTERROR_FALLING;
|
||||||
|
else if (player->IsMirrorTimerActive(FATIGUE_TIMER))
|
||||||
|
error = LFG_TELEPORTERROR_FATIGUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint64 gguid = grp->GetGUID();
|
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(grp->GetGUID()));
|
||||||
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(gguid));
|
|
||||||
|
|
||||||
if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON)
|
if (out)
|
||||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
{
|
||||||
|
// Player needs to be inside the LFG dungeon to be able to teleport out
|
||||||
|
if (dungeon && player->GetMapId() == uint32(dungeon->map))
|
||||||
|
{
|
||||||
|
player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
|
||||||
|
player->TeleportToBGEntryPoint();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player->GetSession()->SendLfgTeleportError(LFG_TELEPORTERROR_DONT_REPORT); // Not sure which error message to send
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!dungeon)
|
if (!dungeon)
|
||||||
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
error = LFG_TELEPORTERROR_INVALID_LOCATION;
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ enum LfgTeleportError
|
|||||||
LFG_TELEPORTERROR_OK = 0, // Internal use
|
LFG_TELEPORTERROR_OK = 0, // Internal use
|
||||||
LFG_TELEPORTERROR_PLAYER_DEAD = 1,
|
LFG_TELEPORTERROR_PLAYER_DEAD = 1,
|
||||||
LFG_TELEPORTERROR_FALLING = 2,
|
LFG_TELEPORTERROR_FALLING = 2,
|
||||||
|
LFG_TELEPORTERROR_DONT_REPORT = 3,
|
||||||
LFG_TELEPORTERROR_FATIGUE = 4,
|
LFG_TELEPORTERROR_FATIGUE = 4,
|
||||||
LFG_TELEPORTERROR_INVALID_LOCATION = 6
|
LFG_TELEPORTERROR_INVALID_LOCATION = 6
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1970,6 +1970,7 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
StopMirrorTimer(BREATH_TIMER);
|
StopMirrorTimer(BREATH_TIMER);
|
||||||
StopMirrorTimer(FIRE_TIMER);
|
StopMirrorTimer(FIRE_TIMER);
|
||||||
}
|
}
|
||||||
|
bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); }
|
||||||
|
|
||||||
void SetMovement(PlayerMovementType pType);
|
void SetMovement(PlayerMovementType pType);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user