aboutsummaryrefslogtreecommitdiff
path: root/src/game/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r--src/game/Map.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 8e72be7ad5e..c4845657eac 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -1110,10 +1110,6 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati
{
DEBUG_LOG("Player %s relocation grid[%u,%u]cell[%u,%u]->grid[%u,%u]cell[%u,%u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
- // update player position for group at taxi flight
- if (player->GetGroup() && player->isInFlight())
- player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
-
NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY());
RemoveFromGrid(player, oldGrid,old_cell);
if (!old_cell.DiffGrid(new_cell))
@@ -1994,24 +1990,23 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps) const
}
}
-float Map::GetVmapHeight(float x, float y, float z, bool useMaps) const
+float Map::GetVmapHeight(float x, float y, float z) const
{
float mapHeight;
- float vmapHeight;
- if (useMaps)
- {
- mapHeight = GetHeight(x, y, z, false);
- if (fabs(mapHeight - z) < 0.1)
- return mapHeight;
- }
- else
- mapHeight = INVALID_HEIGHT;
+
+ mapHeight = GetHeight(x, y, z, false);
+ if (fabs(mapHeight - z) < 0.1)
+ return mapHeight;
+
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
- if (vmgr->isLineOfSightCalcEnabled())
- bool result = vmgr->getObjectHitPos(GetId(), x, y, z + 2.0f, x, y, mapHeight, x, y, vmapHeight, 0);
- else
- return INVALID_HEIGHT;
- return vmapHeight;
+ if (!vmgr->isLineOfSightCalcEnabled())
+ return mapHeight;
+
+ float vmapHeight = vmgr->getHeight(GetId(), x, y, z + 2.0f, z + 2.0f - mapHeight);
+ if (vmapHeight > VMAP_INVALID_HEIGHT_VALUE)
+ return vmapHeight;
+
+ return mapHeight;
}
uint16 Map::GetAreaFlag(float x, float y, float z) const