summaryrefslogtreecommitdiff
path: root/ui/editNetwork.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2025-05-12 00:23:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2025-05-12 00:23:42 +0100
commitb3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd (patch)
tree2f136cb121ef5aa5a78267ccbfa220ca87b56aac /ui/editNetwork.cpp
parentSplit definition creation from link creation (diff)
downloadilt-b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd.tar.bz2
ilt-b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd.tar.xz
ilt-b3105c56c277f6e1e27a3e5e5ee5e1b6c3f47afd.zip
Split link generation definitions according to terrain
Copies the same imperfect logic from old link addition functions.
Diffstat (limited to 'ui/editNetwork.cpp')
-rw-r--r--ui/editNetwork.cpp6
1 files changed, 4 insertions, 2 deletions
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 Ray<GlobalPosition3
}
else {
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});
for (const auto & link : candidates) {
network->add(gameState->terrain.get(), link);
}
@@ -46,7 +47,8 @@ EditNetwork::move(const SDL_MouseMotionEvent &, const Ray<GlobalPosition3D> & 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;