From cff9ddfcd8ee821de85a84c18727f36c08946c80 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 10 May 2025 23:57:39 +0100 Subject: Set terrain height and surface when adding link --- game/network/network.impl.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'game/network/network.impl.h') diff --git a/game/network/network.impl.h b/game/network/network.impl.h index 54a5f4b..7f7dfb3 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -162,7 +162,7 @@ NetworkOf::create(const GenCurveDef & def) template void -NetworkOf::add(const GeoData *, const Link::Ptr & link) +NetworkOf::add(GeoData * geoData, const Link::Ptr & link) { const auto addIf = [this](auto && lptr) { if (lptr) { @@ -178,4 +178,7 @@ NetworkOf::add(const GeoData *, const Link::Ptr & link) throw std::logic_error("Unsupported link type for network"); } joinLinks(link); + if (geoData) { + geoData->setHeights(link->getBase(getBaseWidth()), GeoData::SetHeightsOpts {.surface = getBaseSurface()}); + } } -- cgit v1.2.3