MoveTo while saving guard position no longer hops.

This commit is contained in:
Paul Coene
2017-11-17 13:12:26 -05:00
parent ceadb1325d
commit 5880593cb1
4 changed files with 79 additions and 46 deletions
+13 -2
View File
@@ -123,8 +123,6 @@ Mob::Mob(const char* in_name,
tar_vector=0;
currently_fleeing = false;
last_z = 0;
last_major_update_position = m_Position;
AI_Init();
@@ -3439,6 +3437,19 @@ void Mob::SetTarget(Mob* mob) {
this->GetTarget()->SendHPUpdate(false, true);
}
// For when we want a Ground Z at a location we are not at yet
// Like MoveTo.
float Mob::FindDestGroundZ(glm::vec3 dest, float z_offset)
{
float best_z = BEST_Z_INVALID;
if (zone->zonemap != nullptr)
{
dest.z += z_offset;
best_z = zone->zonemap->FindBestZ(dest, nullptr);
}
return best_z;
}
float Mob::FindGroundZ(float new_x, float new_y, float z_offset)
{
float ret = BEST_Z_INVALID;