Hi Martin,
Have a look at UnitActor::GetIDAndType.
The terrain values are decoded in citystyle.cdb as 0 = land, 1 = ocean.
As you see, if either GetMovementTypeLand() or GetMovementTypeMountain() returns TRUE, 'terrain' is set to 0. Therefore it looks to me as if your tunnel causes GetMovementTypeLand() to return TRUE and therefore you get a land city. I presume a different method should be used to determine if the underlaying cell is ocean or not.
I can't directly test any of this until I get my hands on a copy of CtP2.
Have a look at UnitActor::GetIDAndType.
Code:
if (isCity) { sint32 style; sint32 terrain; sint32 size; const TerrainRecord *rec = g_theTerrainDB->Get(g_theWorld->GetTileInfo(pos)->GetTerrainType()); if(rec->GetMovementTypeLand() || rec->GetMovementTypeMountain()) { terrain = 0; } else { terrain = 1; }
As you see, if either GetMovementTypeLand() or GetMovementTypeMountain() returns TRUE, 'terrain' is set to 0. Therefore it looks to me as if your tunnel causes GetMovementTypeLand() to return TRUE and therefore you get a land city. I presume a different method should be used to determine if the underlaying cell is ocean or not.
I can't directly test any of this until I get my hands on a copy of CtP2.
Comment