diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index d8c68bb5..eae1a60c 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2563,7 +2563,9 @@ void Creature::OnLand() } { glm::vec3 center = GetPos().ToGlmVec3(); + #if 0 room->map_instance->PtInHouse(GetPos().ToGlmVec3(), center); + #endif room->map_instance->Scale(center); glm::vec3 point; bool ok = false; @@ -2587,6 +2589,7 @@ void Creature::OnLand() abort(); #endif } else { + room->map_instance->AdjustOnLandPoint(point); room->map_instance->UnScale(point); } Global::Instance()->verify_set_pos = 1; @@ -2595,6 +2598,7 @@ void Creature::OnLand() GetMovement()->ClearPath(); room->grid_service->MoveCreature(this); #ifdef DEBUG + if (IsPlayer()) { a8::XPrintf("OnLoad ok:%d pos:%f,%f,%f\n", { ok ? 1 : 0, @@ -2602,6 +2606,7 @@ void Creature::OnLand() point.y, point.z }); + } #endif } if (IsAndroid()) { diff --git a/server/gameserver/mapinstance.cc b/server/gameserver/mapinstance.cc index d23dd777..b3c71efb 100644 --- a/server/gameserver/mapinstance.cc +++ b/server/gameserver/mapinstance.cc @@ -1136,7 +1136,7 @@ void MapInstance::AdjustOnLandPoint(glm::vec3& point) } glm::vec3 orig = glm::vec3(point.x, 100.0f, point.z);; - glm::vec3 dir = glm::vec3(0.0f, 1.0f, 0.0f); + glm::vec3 dir = glm::vec3(0.0f, -1.0f, 0.0f); const dtPoly* nearest_poly = nullptr; float nearest_distance = 0.0f; @@ -1192,4 +1192,5 @@ void MapInstance::AdjustOnLandPoint(glm::vec3& point) return; } glm::vec3 nearest_pt = orig + dir * nearest_distance; + point.y = nearest_pt.y; }