1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00
This commit is contained in:
Tomasz Zieliński
2022-09-19 16:13:58 +02:00
parent 7ba271edf1
commit b20f649521
12 changed files with 221 additions and 184 deletions

View File

@@ -165,7 +165,7 @@ void ObjectTemplate::readTxt(CLegacyConfigParser & parser)
//assuming that object can be placed on other land terrains
if(allowedTerrains.size() >= 8 && !allowedTerrains.count(Terrain("water")))
{
for(auto & terrain : Terrain::Manager::terrains())
for(auto & terrain : VLC->terrainTypeHandler::terrains())
{
if(terrain.isLand() && terrain.isPassable())
allowedTerrains.insert(terrain);
@@ -238,7 +238,7 @@ void ObjectTemplate::readMap(CBinaryReader & reader)
//assuming that object can be placed on other land terrains
if(allowedTerrains.size() >= 8 && !allowedTerrains.count(Terrain("water")))
{
for(auto & terrain : Terrain::Manager::terrains())
for(auto & terrain : VLC->terrainTypeHandler::terrains())
{
if(terrain.isLand() && terrain.isPassable())
allowedTerrains.insert(terrain);
@@ -289,7 +289,7 @@ void ObjectTemplate::readJson(const JsonNode &node, const bool withTerrain)
}
else
{
for(auto & i : Terrain::Manager::terrains())
for(auto & i : VLC->terrainTypeHandler::terrains())
{
if(!i.isPassable() || i.isWater())
continue;
@@ -369,7 +369,7 @@ void ObjectTemplate::writeJson(JsonNode & node, const bool withTerrain) const
if(withTerrain)
{
//assumed that ROCK and WATER terrains are not included
if(allowedTerrains.size() < (Terrain::Manager::terrains().size() - 2))
if(allowedTerrains.size() < (VLC->terrainTypeHandler::terrains().size() - 2))
{
JsonVector & data = node["allowedTerrains"].Vector();