1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Merge pull request #6300 from Opuszek/fix_terrain_patterns

Fix terrain patterns
This commit is contained in:
Ivan Savenko
2025-11-09 16:50:58 +02:00
committed by GitHub
2 changed files with 21 additions and 9 deletions

View File

@@ -124,7 +124,7 @@
"data" : "data" :
[ [
"N", "N", "S", "N", "N", "S",
"N", "N", "D", "N", "N", "D,N",
"D,N", "D", "D,N" "D,N", "D", "D,N"
], ],
"mapping" : { "normal" : "44", "hota" : "72" } "mapping" : { "normal" : "44", "hota" : "72" }
@@ -197,8 +197,8 @@
"data" : "data" :
[ [
"N", "N", "N", "N", "N", "N",
"N", "N", "s3-1,m7-1,m8-1", "N", "N", "s3-1,m7-1,m8-1,s1-1",
"N", "s2-1,m7-1,m8-1", "T" "N", "s2-1,m7-1,m8-1,s1-1", "T"
], ],
"minPoints" : 2, "minPoints" : 2,
"mapping" : { "normal" : "12-15, 32-35", "dirt" : "12-15", "water" : "12-15", "rock": "4D:24-31", "hota" : "22-27,56-61" } "mapping" : { "normal" : "12-15, 32-35", "dirt" : "12-15", "water" : "12-15", "rock": "4D:24-31", "hota" : "22-27,56-61" }
@@ -229,11 +229,23 @@
"id" : "s1", "id" : "s1",
"data" : "data" :
[ [
"?", "?", "?", "?", "S-1,?", "?",
"?", "N", "N", "S-1,?", "N", "N",
"T", "N", "N" "?", "N", "N"
], ],
"mapping" : { "normal" : "0-3, 20-23", "dirt" : "0-3", "water" : "0-3", "rock": "4D:8-15", "hota" : "0-5,34-39" } "minPoints" : 1,
"mapping" : { "normal" : "20-23", "dirt" : "0-3", "water" : "0-3", "rock": "4D:8-15", "hota" : "34-39" }
},
{
"id" : "s7",
"data" :
[
"?", "D-1,?", "?",
"D-1,?", "N", "N",
"?", "N", "N"
],
"minPoints" : 1,
"mapping" : { "normal" : "0-3", "rock": "4D:8-15", "hota" : "0-5" }
} }
], ],
"terrainType" : "terrainType" :

View File

@@ -421,9 +421,9 @@ CDrawTerrainOperation::ValidationResult CDrawTerrainOperation::validateTerrainVi
{ {
if(recDepth == 0 && map->isInTheMap(currentPos)) if(recDepth == 0 && map->isInTheMap(currentPos))
{ {
if(terType->getId() == centerTerType->getId()) if(centerTerType->getId() == terType->getId() || (centerTerType->getId() == ETerrainId::DIRT && !terType->isTransitionRequired()))
{ {
const auto patternForRule = LIBRARY->terviewh->getTerrainViewPatternsById(centerTerType->getId(), rule.name); const auto patternForRule = LIBRARY->terviewh->getTerrainViewPatternsById(terType->getId(), rule.name);
if(auto p = patternForRule) if(auto p = patternForRule)
{ {
auto rslt = validateTerrainView(currentPos, &(p->get()), 1); auto rslt = validateTerrainView(currentPos, &(p->get()), 1);