diff --git a/server/gameserver/mapinstance.cc b/server/gameserver/mapinstance.cc index f99b32e6..b2c451d2 100644 --- a/server/gameserver/mapinstance.cc +++ b/server/gameserver/mapinstance.cc @@ -666,6 +666,28 @@ bool MapInstance::RaycastEx(int layer, const glm::vec3& start, const glm::vec3& } hit_pos_[1] = closest[1]; } + { + bool is_same_flags = true; + unsigned short last_flags = 0; + spec_polys.reserve(npolys); + for (int i = 0; i < npolys; ++i) { + unsigned short flags = 0; + status = navmesh_->getPolyFlags(polys_[i], &flags); + if (!dtStatusSucceed(status)) { + abort(); + } + if (flags) { + if (last_flags && last_flags != flags) { + is_same_flags = false; + } + last_flags = flags; + spec_polys.push_back(flags); + } + } + if (is_same_flags) { + same_polys_flags = last_flags; + } + } hit_point.x = hit_pos_[0]; hit_point.y = hit_pos_[1]; diff --git a/server/gameserver/mapinstance.h b/server/gameserver/mapinstance.h index f39d25c4..68dc0472 100644 --- a/server/gameserver/mapinstance.h +++ b/server/gameserver/mapinstance.h @@ -5,19 +5,6 @@ const int MAX_POLYS = 256; -struct HeightInfo -{ - int t = 0; - int h = 0; -}; - -struct GridInfo -{ - bool is_perfect = false; - std::vector layers; - std::vector> details; -}; - class Entity; class Obstacle; class MapService; @@ -77,10 +64,6 @@ class MapInstance : public std::enable_shared_from_this std::vector poly_ext_datas_; - int grid_width_ = 0; - int grid_height_ = 0; - std::vector height_datas_; - std::string map_tpl_name_; const mt::Map* map_meta_ = nullptr; MapService* map_service_ = nullptr;