1
This commit is contained in:
parent
7cee55b4ca
commit
d24b0201d6
@ -3576,21 +3576,22 @@ void Creature::ActivateTargetValidPos()
|
|||||||
glm::vec3 dir = GetPos().ToGlmVec3() - context_pos.ToGlmVec3();
|
glm::vec3 dir = GetPos().ToGlmVec3() - context_pos.ToGlmVec3();
|
||||||
GlmHelper::Normalize(dir);
|
GlmHelper::Normalize(dir);
|
||||||
dir.y = 0;
|
dir.y = 0;
|
||||||
while (distance > 10) {
|
|
||||||
|
|
||||||
}
|
bool found = false;
|
||||||
if (distance > 600 || distance < 10) {
|
glm::vec3 found_pos;
|
||||||
|
{
|
||||||
} else {
|
float move_len = 0;
|
||||||
glm::vec3 center = context_pos.ToGlmVec3();
|
while (move_len + 10 < distance) {
|
||||||
|
glm::vec3 center = context_pos.ToGlmVec3() + dir * move_len;
|
||||||
room->map_instance->Scale(center);
|
room->map_instance->Scale(center);
|
||||||
|
|
||||||
glm::vec3 point;
|
bool ok = room->map_instance->FindConnectableNearestPoint(center, 0.3f, found_pos);
|
||||||
bool ok = room->map_instance->FindConnectableNearestPoint(center, 0.3f, point);
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
room->map_instance->UnScale(point);
|
room->map_instance->UnScale(found_pos);
|
||||||
target_valid_pos = point;
|
found = true;
|
||||||
} else {
|
break;
|
||||||
|
}
|
||||||
|
move_len += 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user