From b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 12 May 2025 00:23:42 +0100 Subject: Split link generation definitions according to terrain Copies the same imperfect logic from old link addition functions. --- ui/editNetwork.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui/editNetwork.cpp') diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp index cab13f2..98a60d3 100644 --- a/ui/editNetwork.cpp +++ b/ui/editNetwork.cpp @@ -21,7 +21,8 @@ EditNetwork::click(const SDL_MouseButtonEvent & event, const Raycreate(CreationDefinition {.fromEnd = *currentStart, .toEnd = *def}); + candidates = network->create( + gameState->terrain.get(), CreationDefinition {.fromEnd = *currentStart, .toEnd = *def}); for (const auto & link : candidates) { network->add(gameState->terrain.get(), link); } @@ -46,7 +47,8 @@ EditNetwork::move(const SDL_MouseMotionEvent &, const Ray & ra { if (currentStart) { if (const auto def = resolveRay(ray)) { - candidates = network->create(CreationDefinition {.fromEnd = *currentStart, .toEnd = *def}); + candidates = network->create( + gameState->terrain.get(), CreationDefinition {.fromEnd = *currentStart, .toEnd = *def}); } } return false; -- cgit v1.2.3