mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Fixed asserts (only for debug build)
This commit is contained in:
@ -194,7 +194,7 @@ void TerrainTypeHandler::initTerrains(const std::vector<std::string> & allConfig
|
|||||||
for(size_t i = Terrain::FIRST_REGULAR_TERRAIN; i < Terrain::ORIGINAL_TERRAIN_COUNT; i++)
|
for(size_t i = Terrain::FIRST_REGULAR_TERRAIN; i < Terrain::ORIGINAL_TERRAIN_COUNT; i++)
|
||||||
{
|
{
|
||||||
//Make sure that original terrains are loaded
|
//Make sure that original terrains are loaded
|
||||||
assert(objects(i).id != Terrain::WRONG);
|
assert(objects[i].id != Terrain::WRONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
recreateTerrainMaps();
|
recreateTerrainMaps();
|
||||||
|
@ -157,7 +157,7 @@ void ObjectTemplate::readTxt(CLegacyConfigParser & parser)
|
|||||||
// so these two fields can be interpreted as "strong affinity" and "weak affinity" towards terrains
|
// so these two fields can be interpreted as "strong affinity" and "weak affinity" towards terrains
|
||||||
std::string & terrStr = strings[4]; // allowed terrains, 1 = object can be placed on this terrain
|
std::string & terrStr = strings[4]; // allowed terrains, 1 = object can be placed on this terrain
|
||||||
|
|
||||||
assert(terrStr.size() == Terrain::ROCK - 1); // all terrains but rock
|
assert(terrStr.size() == Terrain::ROCK); // all terrains but rock - counting from 0
|
||||||
for(TerrainId i = Terrain::FIRST_REGULAR_TERRAIN; i < Terrain::ROCK; i++)
|
for(TerrainId i = Terrain::FIRST_REGULAR_TERRAIN; i < Terrain::ROCK; i++)
|
||||||
{
|
{
|
||||||
if (terrStr[8-i] == '1')
|
if (terrStr[8-i] == '1')
|
||||||
|
@ -43,7 +43,7 @@ void WaterProxy::process()
|
|||||||
for(auto & t : zone.area().getTilesVector())
|
for(auto & t : zone.area().getTilesVector())
|
||||||
{
|
{
|
||||||
assert(map.isOnMap(t));
|
assert(map.isOnMap(t));
|
||||||
assert(map.map().getTile(t).terType == zone.getTerrainType());
|
assert(map.map().getTile(t).terType->id == zone.getTerrainType());
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto z : map.getZones())
|
for(auto z : map.getZones())
|
||||||
|
Reference in New Issue
Block a user