This commit is contained in:
aozhiwei 2019-09-11 11:36:52 +08:00
parent c1b20c8ac1
commit 532838ebca
2 changed files with 14 additions and 15 deletions

View File

@ -216,4 +216,3 @@ const int MAX_ALL_HTTP_NUM = MAX_SYS_HTTP_NUM + MAX_USER_HTTP_NUM;
const int DEFAULT_BORN_POINT_X = 3000;
const int DEFAULT_BORN_POINT_Y = 3000;
const int BORN_POINT_THINGID = -10000;

View File

@ -312,25 +312,25 @@ namespace MetaData
void MapTplThing::Init()
{
rand_space = 0;
std::vector<std::string> strings;
a8::Split(i->things(), strings, '\n');
for (auto& str : strings) {
std::vector<std::string> strings2;
a8::Split(str, strings2, ':');
assert(strings2.size() == 2);
rand_space += a8::XValue(strings2[1]).GetInt();
things.push_back(std::make_tuple(
a8::XValue(strings2[0]),
rand_space
)
);
}
metatable::MapTplThingJson* mutable_i = (metatable::MapTplThingJson*)i;
if (mutable_i->object_type() == "spawn_point") {
mutable_i->set__object_type(kMOT_SpawnPoint);
} else {
mutable_i->set__object_type(kMOT_Object);
rand_space = 0;
std::vector<std::string> strings;
a8::Split(i->things(), strings, '\n');
for (auto& str : strings) {
std::vector<std::string> strings2;
a8::Split(str, strings2, ':');
assert(strings2.size() == 2);
rand_space += a8::XValue(strings2[1]).GetInt();
things.push_back(std::make_tuple(
a8::XValue(strings2[0]),
rand_space
)
);
}
}
}