Skip to content

Commit 2fbabdb

Browse files
committed
Fix missing code for Ramp Corners
Ramp Corner's require a ground tile under them
1 parent c72d1ac commit 2fbabdb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/TerrainGen/Terrain_Gen.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ Dictionary TerrainGen::generate(
3232
//
3333
// Produce a 2x Grid for the Data Grid
3434
//
35-
//TODO Ensure Width & Height are divisable by BlockSize / Error Catching
3635
int widthx2 = width * 2;
3736
int heightx2 = height * 2;
3837

38+
// TODO : Fix blocksize so it doesn't cause errors
3939
//
4040
// Noise Conversion Variables
4141
//
@@ -893,6 +893,8 @@ Dictionary TerrainGen::generate(
893893
// Cliff's & Ramp's Corner
894894
//-------------------------//
895895

896+
// TODO : Ramp Corner needs a Ground Tile placed one elevation below it
897+
896898
// Corner EAST
897899
// +----+----+ +---+---+
898900
// | n1 | n2 | | 1 | 1 |
@@ -1257,6 +1259,8 @@ Dictionary TerrainGen::generate(
12571259
// }
12581260
// }
12591261

1262+
//
1263+
//
12601264
//
12611265
// Phase 2 : Determine the Tile's Rotation
12621266
//
@@ -1325,6 +1329,15 @@ Dictionary TerrainGen::generate(
13251329
int nwHeight = safe_height(x - 1, y + 1, c_height);
13261330
int nwTile = safe_tile_at(x - 1, y + 1); // m1
13271331

1332+
// +----+----+ +----+----+
1333+
// | n1 | n2 | | g1 | r2 |
1334+
// +----+----+ +----+----+
1335+
// | n3 | n4 | | r2 | g2 |
1336+
// +----+----+ +----+----+
1337+
//
1338+
// ? : Above is an edge case that needs fixed
1339+
// TODO : Replace the Ramps in this situation with CLiff edges using the orientation of the ramp's
1340+
13281341
if (tile_id == RAMP || tile_id == CLIFF || tile_id == WATER_EDGE) {
13291342
// +----+----+----+
13301343
// | m1 | m2 | m3 |
@@ -1491,6 +1504,11 @@ Dictionary TerrainGen::generate(
14911504
}
14921505
}
14931506

1507+
if (tile_id == RAMP_CORNER) {
1508+
// Place Ground under Ramp Tiles
1509+
myGridMap->set_cell_item(Vector3i(x, c_height - 1, y), GROUND, rotation_val);
1510+
}
1511+
14941512
myGridMap->set_cell_item(Vector3i(x, c_height, y), tile_id, rotation_val);
14951513
}
14961514
}

0 commit comments

Comments
 (0)