mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
Partial port of der's map rewrite, no new azone format yet but it's coming. Will convert legacy map formats on the fly atm.
This commit is contained in:
+17
-27
@@ -2933,22 +2933,17 @@ void Mob::SetTarget(Mob* mob) {
|
||||
float Mob::FindGroundZ(float new_x, float new_y, float z_offset)
|
||||
{
|
||||
float ret = -999999;
|
||||
if (zone->zonemap != 0)
|
||||
if (zone->zonemap != nullptr)
|
||||
{
|
||||
NodeRef pnode = zone->zonemap->SeekNode( zone->zonemap->GetRoot(), new_x, new_y );
|
||||
if (pnode != NODE_NONE)
|
||||
Map::Vertex me;
|
||||
me.x = new_x;
|
||||
me.y = new_y;
|
||||
me.z = z_pos+z_offset;
|
||||
Map::Vertex hit;
|
||||
float best_z = zone->zonemap->FindBestZ(me, &hit);
|
||||
if (best_z != -999999)
|
||||
{
|
||||
VERTEX me;
|
||||
me.x = new_x;
|
||||
me.y = new_y;
|
||||
me.z = z_pos+z_offset;
|
||||
VERTEX hit;
|
||||
FACE *onhit;
|
||||
float best_z = zone->zonemap->FindBestZ(pnode, me, &hit, &onhit);
|
||||
if (best_z != -999999)
|
||||
{
|
||||
ret = best_z;
|
||||
}
|
||||
ret = best_z;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -2960,20 +2955,15 @@ float Mob::GetGroundZ(float new_x, float new_y, float z_offset)
|
||||
float ret = -999999;
|
||||
if (zone->zonemap != 0)
|
||||
{
|
||||
NodeRef pnode = zone->zonemap->SeekNode( zone->zonemap->GetRoot(), new_x, new_y );
|
||||
if (pnode != NODE_NONE)
|
||||
Map::Vertex me;
|
||||
me.x = new_x;
|
||||
me.y = new_y;
|
||||
me.z = z_pos+z_offset;
|
||||
Map::Vertex hit;
|
||||
float best_z = zone->zonemap->FindBestZ(me, &hit);
|
||||
if (best_z != -999999)
|
||||
{
|
||||
VERTEX me;
|
||||
me.x = new_x;
|
||||
me.y = new_y;
|
||||
me.z = z_pos+z_offset;
|
||||
VERTEX hit;
|
||||
FACE *onhit;
|
||||
float best_z = zone->zonemap->FindBestZ(pnode, me, &hit, &onhit);
|
||||
if (best_z != -999999)
|
||||
{
|
||||
ret = best_z;
|
||||
}
|
||||
ret = best_z;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user