fix(Core/LFG): Correct checks for teleport in/out (#17780)
This commit is contained in:
@@ -2128,14 +2128,6 @@ namespace lfg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (out)
|
|
||||||
{
|
|
||||||
if (player->GetMapId() == uint32(dungeon->map))
|
|
||||||
player->TeleportToEntryPoint();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
LfgTeleportError error = LFG_TELEPORTERROR_OK;
|
||||||
|
|
||||||
if (!player->IsAlive())
|
if (!player->IsAlive())
|
||||||
@@ -2158,6 +2150,13 @@ namespace lfg
|
|||||||
{
|
{
|
||||||
error = LFG_TELEPORTERROR_COMBAT;
|
error = LFG_TELEPORTERROR_COMBAT;
|
||||||
}
|
}
|
||||||
|
else if (out && error == LFG_TELEPORTERROR_OK)
|
||||||
|
{
|
||||||
|
if (player->GetMapId() == uint32(dungeon->map))
|
||||||
|
player->TeleportToEntryPoint();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint32 mapid = dungeon->map;
|
uint32 mapid = dungeon->map;
|
||||||
@@ -2183,11 +2182,18 @@ namespace lfg
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error != LFG_TELEPORTERROR_OK)
|
if (error != LFG_TELEPORTERROR_OK)
|
||||||
|
{
|
||||||
player->GetSession()->SendLfgTeleportError(uint8(error));
|
player->GetSession()->SendLfgTeleportError(uint8(error));
|
||||||
|
|
||||||
//LOG_DEBUG("lfg", "TeleportPlayer: Player {} is being teleported in to map {} "
|
LOG_DEBUG("lfg", "Player [{}] could NOT be teleported in to map [{}] (x: {}, y: {}, z: {}) Error: {}",
|
||||||
// "(x: {}, y: {}, z: {}) Result: {}", player->GetName(), dungeon->map,
|
player->GetName(), dungeon->map, dungeon->x, dungeon->y, dungeon->z, error);
|
||||||
// dungeon->x, dungeon->y, dungeon->z, error);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_DEBUG("lfg", "Player [{}] is being teleported in to map [{}] (x: {}, y: {}, z: {})",
|
||||||
|
player->GetName(), dungeon->map, dungeon->x, dungeon->y, dungeon->z);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user