fix(Core/LFG): Correct checks for teleport in/out (#17780)

This commit is contained in:
avarishd 2023-11-19 12:34:33 +02:00 committed by GitHub
parent 9ecb85acb5
commit 4bf20ffde4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2128,14 +2128,6 @@ namespace lfg
return;
}
if (out)
{
if (player->GetMapId() == uint32(dungeon->map))
player->TeleportToEntryPoint();
return;
}
LfgTeleportError error = LFG_TELEPORTERROR_OK;
if (!player->IsAlive())
@ -2158,6 +2150,13 @@ namespace lfg
{
error = LFG_TELEPORTERROR_COMBAT;
}
else if (out && error == LFG_TELEPORTERROR_OK)
{
if (player->GetMapId() == uint32(dungeon->map))
player->TeleportToEntryPoint();
return;
}
else
{
uint32 mapid = dungeon->map;
@ -2183,11 +2182,18 @@ namespace lfg
}
if (error != LFG_TELEPORTERROR_OK)
{
player->GetSession()->SendLfgTeleportError(uint8(error));
//LOG_DEBUG("lfg", "TeleportPlayer: Player {} is being teleported in to map {} "
// "(x: {}, y: {}, z: {}) Result: {}", player->GetName(), dungeon->map,
// dungeon->x, dungeon->y, dungeon->z, error);
LOG_DEBUG("lfg", "Player [{}] could NOT be teleported in to map [{}] (x: {}, y: {}, z: {}) Error: {}",
player->GetName(), dungeon->map, 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);
}
}
/**