diff --git a/server/gameserver/mapinstance.cc b/server/gameserver/mapinstance.cc index 6a46b1cd..cae6fa1f 100644 --- a/server/gameserver/mapinstance.cc +++ b/server/gameserver/mapinstance.cc @@ -882,5 +882,5 @@ bool MapInstance::SceneRaycast(const glm::vec3& orig, float max_distance, glm::vec3& hit_pos) { - + int raycast_index = MapMgr::Instance()->IncCurrRaycastIndex(); } diff --git a/server/gameserver/mapmgr.cc b/server/gameserver/mapmgr.cc index c10c144d..55389a13 100644 --- a/server/gameserver/mapmgr.cc +++ b/server/gameserver/mapmgr.cc @@ -23,6 +23,7 @@ void MapMgr::Init() map_instance->map_id = map_meta->map_id(); map_instance->Init(); instance_hash_[map_instance->map_id] = map_instance; + instance_list_.push_back(map_instance); { auto itr = mode_hash_.find(map_meta->map_mode()); if (itr != mode_hash_.end()) { diff --git a/server/gameserver/mapmgr.h b/server/gameserver/mapmgr.h index dbdcd12a..439f5c8a 100644 --- a/server/gameserver/mapmgr.h +++ b/server/gameserver/mapmgr.h @@ -17,11 +17,14 @@ public: void AttachRoom(Room* room, RoomInitInfo& init_info); std::shared_ptr GetMapInstance(int map_id); + int IncCurrRaycastIndex() { return ++curr_raycast_index_; }; private: std::shared_ptr RandMapInstance(int map_mode); private: + int curr_raycast_index_ = 1000; + std::vector> instance_list_; std::map> instance_hash_; std::map>> mode_hash_; };