mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-18 17:40:48 +02:00
Revert "Obstacles works fine without regression"
This reverts commit c3276f2276
.
This commit is contained in:
parent
b68220d1c3
commit
1a78df69f2
@ -88,9 +88,5 @@
|
||||
"battlefields":
|
||||
[
|
||||
"config/battlefields.json"
|
||||
],
|
||||
"obstacles":
|
||||
[
|
||||
"config/obstacles.json"
|
||||
]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
"type":"object",
|
||||
"$schema": "http://json-schema.org/draft-04/schema",
|
||||
"title" : "VCMI battlefield format",
|
||||
"description" : "Format used to define new battlefields in VCMI",
|
||||
"description" : "Format used to define new artifacts in VCMI",
|
||||
"required" : [ "graphics" ],
|
||||
|
||||
"additionalProperties" : false,
|
||||
|
@ -1,46 +0,0 @@
|
||||
{
|
||||
"type":"object",
|
||||
"$schema": "http://json-schema.org/draft-04/schema",
|
||||
"title" : "VCMI obstacle format",
|
||||
"description" : "Format used to define new obstacles in VCMI",
|
||||
"required" : [ "defname" ],
|
||||
|
||||
"additionalProperties" : false,
|
||||
"properties":{
|
||||
"allowedTerrains": {
|
||||
"type": "array",
|
||||
"description": "Obstacles can be place on specified terrains only",
|
||||
"items": { "type" : "string" }
|
||||
},
|
||||
"specialBattlefields": {
|
||||
"type": "array",
|
||||
"description": "Obstacles can be placed on specified specified battlefields",
|
||||
"items": { "$ref" : "battlefield.json" }
|
||||
},
|
||||
"width": {
|
||||
"type": "number",
|
||||
"description": "Width ob obstacle"
|
||||
},
|
||||
"height": {
|
||||
"type": "number",
|
||||
"description": "height if obstacle"
|
||||
},
|
||||
"blockedTiles": {
|
||||
"type": "array",
|
||||
"description": "Blocked hexes - absolute or relative hex id",
|
||||
"items": { "type" : "number" }
|
||||
},
|
||||
"defname": {
|
||||
"type": "string",
|
||||
"description": "Image resource"
|
||||
},
|
||||
"unknown": {
|
||||
"type": "number",
|
||||
"description": "Unknown field"
|
||||
},
|
||||
"absolute": {
|
||||
"type": "boolean",
|
||||
"description": "Should be used absulute or relative coordinates for obstacle. There is possible only one absolute obstacle"
|
||||
}
|
||||
}
|
||||
}
|
@ -10,7 +10,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <vcmi/EntityService.h>
|
||||
#include <vcmi/Entity.h>
|
||||
#include "HeroBonus.h"
|
||||
#include "GameConstants.h"
|
||||
#include "IHandlerBase.h"
|
||||
|
@ -23,7 +23,7 @@ int32_t ObstacleInfo::getIconIndex() const
|
||||
|
||||
const std::string & ObstacleInfo::getName() const
|
||||
{
|
||||
return identifier;
|
||||
return name;
|
||||
}
|
||||
|
||||
const std::string & ObstacleInfo::getJsonKey() const
|
||||
|
@ -22,12 +22,13 @@ struct DLL_LINKAGE ObstacleInfo : public EntityT<Obstacle>
|
||||
{}
|
||||
|
||||
ObstacleInfo(Obstacle obstacle, std::string identifier)
|
||||
: obstacle(obstacle), identifier(identifier), iconIndex(obstacle.getNum()), width(0), height(0), isAbsoluteObstacle(false)
|
||||
: obstacle(obstacle), identifier(identifier), iconIndex(obstacle.getNum()), name(identifier), width(0), height(0), isAbsoluteObstacle(false)
|
||||
{
|
||||
}
|
||||
|
||||
Obstacle obstacle;
|
||||
si32 iconIndex;
|
||||
std::string name;
|
||||
std::string identifier;
|
||||
std::string defName;
|
||||
std::vector<Terrain> allowedTerrains;
|
||||
@ -52,6 +53,7 @@ struct DLL_LINKAGE ObstacleInfo : public EntityT<Obstacle>
|
||||
{
|
||||
h & obstacle;
|
||||
h & iconIndex;
|
||||
h & name;
|
||||
h & identifier;
|
||||
h & defName;
|
||||
h & allowedTerrains;
|
||||
|
Loading…
Reference in New Issue
Block a user