修复重复创建问题

This commit is contained in:
aozhiwei 2019-09-26 19:59:14 +08:00
parent b8de4b85b1
commit f7e8eb37e1

View File

@ -142,12 +142,13 @@ private:
parameter_hash[item.i->param_name()] = &item; parameter_hash[item.i->param_name()] = &item;
} }
{
for (auto& meta : map_meta_list) { for (auto& meta : map_meta_list) {
MetaData::Map& item = a8::FastAppend(map_list); MetaData::Map& item = a8::FastAppend(map_list);
item.i = &meta; item.i = &meta;
item.Init(); item.Init();
gamemap_hash[item.i->map_id()] = &item; gamemap_hash[item.i->map_id()] = &item;
#if 1 #if 1
{ {
for (auto& tuple : item.template_list) { for (auto& tuple : item.template_list) {
auto itr = maptpl_meta_hash.find(std::get<0>(tuple)); auto itr = maptpl_meta_hash.find(std::get<0>(tuple));
@ -159,6 +160,9 @@ private:
} }
f8::ReadJsonMetaFile(res_path + std::get<0>(tuple) + ".json", itr->second); f8::ReadJsonMetaFile(res_path + std::get<0>(tuple) + ".json", itr->second);
} }
}
#endif
}
for (auto& pair : maptpl_meta_hash) { for (auto& pair : maptpl_meta_hash) {
std::vector<MetaData::MapTplThing> things; std::vector<MetaData::MapTplThing> things;
for (auto& itr : pair.second) { for (auto& itr : pair.second) {
@ -169,8 +173,6 @@ private:
maptpl_hash[pair.first] = things; maptpl_hash[pair.first] = things;
} }
} }
#endif
}
for (auto& meta : safearea_meta_list) { for (auto& meta : safearea_meta_list) {
MetaData::SafeArea& item = a8::FastAppend(safearea_list); MetaData::SafeArea& item = a8::FastAppend(safearea_list);