1
This commit is contained in:
parent
e73f4389e1
commit
fd14c02ac6
@ -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()) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user