feat(editor): river tool now fills water along the carved path

The river path tool used to carve the channel and texture the banks
but never added a water layer — users had to manually run
"Fill Water" afterward, which floods the entire tile. The fix is a
new TerrainEditor::fillWaterAlongPath() method that adds water
layers only to chunks the river segment passes through (within
width + chunk-half-diagonal of the line).

Per-chunk water height is set to the chunk's post-carve minimum
terrain height + 0.5y offset so the water sits visibly in the
channel without overflowing onto banks.

The river apply path now invokes carveRiver → paintAlongPath →
fillWaterAlongPath in sequence. Toast updated to mention all three.

Multi-point rivers are still next on the list — the underlying
math takes a single segment today, so a polyline river needs a UI
revamp to capture N points + a per-segment loop. Ack'd, not done
this commit.
This commit is contained in:
Kelsi 2026-05-07 10:17:36 -07:00
parent ecba93d4a4
commit 158ab192f0
3 changed files with 84 additions and 1 deletions

View file

@ -1049,7 +1049,13 @@ void EditorUI::renderBrushPanel(EditorApp& app) {
app.getTerrainEditor().carveRiver(pathStart_, pathEnd_, pathWidth_, pathDepth_);
app.getTexturePainter().paintAlongPath(pathStart_, pathEnd_, pathWidth_ * 1.5f,
"Tileset\\Ashenvale\\AshenvaleSand.blp");
app.showToast("River carved + banks textured");
// After carving, fill water in the chunks along
// the river path so the channel actually looks
// like a river. liquidType 0 = water (1=ocean,
// 2=magma, 3=slime).
app.getTerrainEditor().fillWaterAlongPath(
pathStart_, pathEnd_, pathWidth_, 0);
app.showToast("River carved + banks textured + water filled");
} else {
app.getTerrainEditor().flattenRoad(pathStart_, pathEnd_, pathWidth_);
app.getTexturePainter().paintAlongPath(pathStart_, pathEnd_, pathWidth_,