From 5ed7a5581740978484d2d2f444ce34360d8a6616 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 17 Feb 2023 16:21:09 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 5 ++++- server/gameserver/mapinstance.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 5472b523..c0fa56a7 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -2606,7 +2606,10 @@ void Creature::OnLand() glm::vec3 point; bool ok = false; for (int i = 0; i < 10; ++i) { - ok = room->map_instance->FindNearestPoint(center, 10 + 10 * i, point); + ok = room->map_instance->FindNearestPoint(center, 1.0f + 10 * i, point); + if (ok) { + break; + } } if (!ok) { abort(); diff --git a/server/gameserver/mapinstance.cc b/server/gameserver/mapinstance.cc index 71ff17e8..68d041cb 100644 --- a/server/gameserver/mapinstance.cc +++ b/server/gameserver/mapinstance.cc @@ -436,7 +436,7 @@ bool MapInstance::FindNearestPoint(const glm::vec3& center, float radius, glm::v filter.setIncludeFlags(0xffff); filter.setExcludeFlags(0); - const float extents[3] = {radius, radius, radius}; + const float extents[3] = {radius, 10.0f, radius}; float nearestPt[3]; float pos[3];