add test.open_world

This commit is contained in:
MihailRis
2024-12-11 14:49:52 +03:00
parent b05c2fc911
commit cfc16679cb
3 changed files with 17 additions and 2 deletions
+4 -2
View File
@@ -133,8 +133,10 @@ std::unique_ptr<Level> World::load(
auto playerRoot = files::read_json(file);
level->players->deserialize(playerRoot);
if (!playerRoot["players"][0].has("id")) {
level->getWorld()->getInfo().nextPlayerId++;
if (!playerRoot["players"].empty()) {
if (!playerRoot["players"][0].has("id")) {
level->getWorld()->getInfo().nextPlayerId++;
}
}
}
return level;