From bc915e2c3fd32fb045ac1a403699671afe134e70 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 25 Oct 2023 11:43:41 +0800 Subject: [PATCH] 1 --- server/gameserver/mt/Map.cc | 2 +- server/gameserver/mtb/Map.h | 5 ++++- server/gameserver/mtb/mtb.all.cc | 3 ++- server/tools/protobuild/mt.proto | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/gameserver/mt/Map.cc b/server/gameserver/mt/Map.cc index cc4ced2c..d8f4b7c0 100644 --- a/server/gameserver/mt/Map.cc +++ b/server/gameserver/mt/Map.cc @@ -133,7 +133,7 @@ namespace mt void Map::Init2() { { - if (!IsPveMap() && safearea_list.empty()) { + if (!IsPveMap() && !is_moba() && safearea_list.empty()) { A8_ABORT(); } for (const int area_type : safearea_list) { diff --git a/server/gameserver/mtb/Map.h b/server/gameserver/mtb/Map.h index e26709e9..2442525e 100644 --- a/server/gameserver/mtb/Map.h +++ b/server/gameserver/mtb/Map.h @@ -38,6 +38,7 @@ namespace mtb const std::string ground_sampling_pos() const { return ground_sampling_pos_; }; const std::string navmesh_file() const { return navmesh_file_; }; int moba_time() const { return moba_time_; }; + int is_moba() const { return is_moba_; }; bool has_map_id() const { return __flags__.test(0);}; bool has_template_list() const { return __flags__.test(1);}; @@ -67,6 +68,7 @@ namespace mtb bool has_ground_sampling_pos() const { return __flags__.test(25);}; bool has_navmesh_file() const { return __flags__.test(26);}; bool has_moba_time() const { return __flags__.test(27);}; + bool has_is_moba() const { return __flags__.test(28);}; protected: @@ -98,9 +100,10 @@ namespace mtb std::string ground_sampling_pos_; std::string navmesh_file_; int moba_time_ = 0; + int is_moba_ = 0; public: - std::bitset<28> __flags__; + std::bitset<29> __flags__; }; }; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index 10756afb..64fcea1a 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -71,7 +71,7 @@ namespace mtb { a8::reflect::Class* meta_class = nullptr; if (!meta_class) { - meta_class = new a8::reflect::Class("Map", 28, 0); + meta_class = new a8::reflect::Class("Map", 29, 0); meta_class->SetSimpleField(0, "map_id", a8::reflect::ET_INT32, my_offsetof2(Map, map_id_)); meta_class->SetSimpleField(1, "template_list", a8::reflect::ET_STRING, my_offsetof2(Map, template_list_)); meta_class->SetSimpleField(2, "map_name", a8::reflect::ET_STRING, my_offsetof2(Map, map_name_)); @@ -100,6 +100,7 @@ namespace mtb meta_class->SetSimpleField(25, "ground_sampling_pos", a8::reflect::ET_STRING, my_offsetof2(Map, ground_sampling_pos_)); meta_class->SetSimpleField(26, "navmesh_file", a8::reflect::ET_STRING, my_offsetof2(Map, navmesh_file_)); meta_class->SetSimpleField(27, "moba_time", a8::reflect::ET_INT32, my_offsetof2(Map, moba_time_)); + meta_class->SetSimpleField(28, "is_moba", a8::reflect::ET_INT32, my_offsetof2(Map, is_moba_)); } return meta_class; } diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index 34b20b60..28f74066 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -43,6 +43,7 @@ message Map optional string ground_sampling_pos = 26; optional string navmesh_file = 27; optional int32 moba_time = 28; + optional int32 is_moba = 29; } message MapArea