1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #1105 from krs0/feature/#1071__In_latest_night_builds_there_are_problems_with_schema_obstacle.json_and_file_obstacles.json

Problems with schema obstacle.json and file obstacles.json #1071
This commit is contained in:
Andrii Danylchenko 2022-11-10 11:53:08 +02:00 committed by GitHub
commit 1ca2283a90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 128 additions and 128 deletions

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
"specialBattlefields": { "specialBattlefields": {
"type": "array", "type": "array",
"description": "Obstacles can be placed on specified specified battlefields", "description": "Obstacles can be placed on specified specified battlefields",
"items": { "$ref" : "battlefield.json" } "items": { "type" : "string" }
}, },
"width": { "width": {
"type": "number", "type": "number",

View File

@ -85,7 +85,7 @@ ObstacleInfo * ObstacleHandler::loadFromJson(const std::string & scope, const Js
info->animation = json["animation"].String(); info->animation = json["animation"].String();
info->width = json["width"].Integer(); info->width = json["width"].Integer();
info->height = json["height"].Integer(); info->height = json["height"].Integer();
for(auto & t : json["allowedTerrain"].Vector()) for(auto & t : json["allowedTerrains"].Vector())
info->allowedTerrains.emplace_back(VLC->terrainTypeHandler->getInfoByName(t.String())->id); info->allowedTerrains.emplace_back(VLC->terrainTypeHandler->getInfoByName(t.String())->id);
for(auto & t : json["specialBattlefields"].Vector()) for(auto & t : json["specialBattlefields"].Vector())
info->allowedSpecialBfields.emplace_back(t.String()); info->allowedSpecialBfields.emplace_back(t.String());