aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Commands/cs_go.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index c7d9f069ae7..90d2b832333 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -347,10 +347,8 @@ public:
mapId = data.MapID;
- Map const* map = sMapMgr->CreateBaseMap(mapId);
x = data.points.front().X;
y = data.points.front().Y;
- z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
}
else
{
@@ -359,7 +357,7 @@ public:
return false;
}
- if (!MapManager::IsValidMapCoord(mapId, x, y, z) || sObjectMgr->IsTransportMap(mapId))
+ if (!MapManager::IsValidMapCoord(mapId, x, y) || sObjectMgr->IsTransportMap(mapId))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
@@ -376,6 +374,9 @@ public:
else
player->SaveRecallPosition();
+ Map const* map = sMapMgr->CreateBaseMap(mapId);
+ z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
+
player->TeleportTo(mapId, x, y, z, 0.0f);
return true;
}