fix(Core/LFG): Prevent leaving LFG if in combat (#9466)
This commit is contained in:
@@ -2104,15 +2104,25 @@ namespace lfg
|
|||||||
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
||||||
|
|
||||||
if (!player->IsAlive())
|
if (!player->IsAlive())
|
||||||
|
{
|
||||||
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))
|
else if (player->IsMirrorTimerActive(FATIGUE_TIMER))
|
||||||
|
{
|
||||||
error = LFG_TELEPORTERROR_FATIGUE;
|
error = LFG_TELEPORTERROR_FATIGUE;
|
||||||
|
}
|
||||||
else if (player->GetVehicle())
|
else if (player->GetVehicle())
|
||||||
|
{
|
||||||
error = LFG_TELEPORTERROR_IN_VEHICLE;
|
error = LFG_TELEPORTERROR_IN_VEHICLE;
|
||||||
else if (player->GetCharmGUID())
|
}
|
||||||
error = LFG_TELEPORTERROR_CHARMING;
|
else if (player->GetCharmGUID() || player->IsInCombat())
|
||||||
|
{
|
||||||
|
error = LFG_TELEPORTERROR_COMBAT;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint32 mapid = dungeon->map;
|
uint32 mapid = dungeon->map;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace lfg
|
|||||||
LFG_TELEPORTERROR_IN_VEHICLE = 3,
|
LFG_TELEPORTERROR_IN_VEHICLE = 3,
|
||||||
LFG_TELEPORTERROR_FATIGUE = 4,
|
LFG_TELEPORTERROR_FATIGUE = 4,
|
||||||
LFG_TELEPORTERROR_INVALID_LOCATION = 6,
|
LFG_TELEPORTERROR_INVALID_LOCATION = 6,
|
||||||
LFG_TELEPORTERROR_CHARMING = 8 // FIXME - It can be 7 or 8 (Need proper data)
|
LFG_TELEPORTERROR_COMBAT = 8 // FIXME - It can be 7 or 8 (Need proper data)
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Queue join results
|
/// Queue join results
|
||||||
|
|||||||
Reference in New Issue
Block a user