From 4c0219e3e0c9c1831751dfbee4bd47b5e865fafc Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 23 Mar 2023 21:58:02 +0800 Subject: [PATCH] 1 --- server/gameserver/mapmgr.cc | 37 +++++++++++++++------------ server/gameserver/mt/PveGeminiMode.cc | 3 ++- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/server/gameserver/mapmgr.cc b/server/gameserver/mapmgr.cc index 0f5d7f6e..d2744ca0 100644 --- a/server/gameserver/mapmgr.cc +++ b/server/gameserver/mapmgr.cc @@ -16,21 +16,22 @@ void MapMgr::Init() ( [this] (const mt::Map* map_meta, bool& stop) { - if (map_meta->map_id() != 2001) { - return; - } - auto map_instance = std::make_shared(); - 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()) { - itr->second.push_back(map_instance); - } else { - mode_hash_[map_meta->map_mode()] = - std::vector>({map_instance}); + if (map_meta->map_id() == 2001 || + map_meta->map_id() == 1003 + ) { + auto map_instance = std::make_shared(); + 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()) { + itr->second.push_back(map_instance); + } else { + mode_hash_[map_meta->map_mode()] = + std::vector>({map_instance}); + } } } }); @@ -84,9 +85,11 @@ void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info) }); #endif } -#ifdef MAP3D - init_info.init_map_id = 2001; +#if 1 auto map_instance = GetMapInstance(init_info.init_map_id); + if (!map_instance) { + map_instance = GetMapInstance(2001); + } #else MapInstance* map_instance = init_info.init_map_id == 0 ? RandMapInstance(init_info.room_mode) : GetMapInstance(init_info.init_map_id); diff --git a/server/gameserver/mt/PveGeminiMode.cc b/server/gameserver/mt/PveGeminiMode.cc index f26fbf57..0384224a 100644 --- a/server/gameserver/mt/PveGeminiMode.cc +++ b/server/gameserver/mt/PveGeminiMode.cc @@ -11,7 +11,6 @@ namespace mt void PveGeminiMode::Init1() { - return; { std::vector strings; a8::Split(mode_time(), strings, '|'); @@ -68,6 +67,7 @@ namespace mt abort(); } } + #if 0 { std::vector strings; a8::Split(round_score(), strings, '|'); @@ -99,6 +99,7 @@ namespace mt } } } + #endif } int PveGeminiMode::CalcStar(int score) const