//----- (00487ED6) -------------------------------------------------------- int TileTable::GetTileForTerrainType( signed int terrain_type, bool not_random ) { int v5; // edx@3 int v6; // edx@11 if ( not_random || terrain_type > 8 ) { return GetTileId(terrain_type, 0); } v5 = rand() % 50; if ( v5 < 20) { return GetTileId(terrain_type, 0); } else if ( v5 < 30 ) { return GetTileId(terrain_type, 1); } else if ( v5 < 40 ) { return GetTileId(terrain_type, 2); } else if ( v5 < 48 ) { return GetTileId(terrain_type, 3); } v6 = rand() % 8; return GetTileId(terrain_type, v6+4); return 0; }
Rect *TileMap::GetTile(int InX, int InY) { return GetCellRect(GetTileId(InX, InY)); }