summaryrefslogtreecommitdiff
path: root/game/network/rail.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-02-14 13:14:32 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-02-14 13:14:32 +0000
commitdd80098076cda9c103b44356ca07c2c8bc7698d7 (patch)
treeabea9da9105f33d8449bad00241d8406954d7bfb /game/network/rail.h
parentCorrectly scaled rails (diff)
downloadilt-dd80098076cda9c103b44356ca07c2c8bc7698d7.tar.bz2
ilt-dd80098076cda9c103b44356ca07c2c8bc7698d7.tar.xz
ilt-dd80098076cda9c103b44356ca07c2c8bc7698d7.zip
Join links in rail graph
Diffstat (limited to 'game/network/rail.h')
-rw-r--r--game/network/rail.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/game/network/rail.h b/game/network/rail.h
index 5fea713..a501f32 100644
--- a/game/network/rail.h
+++ b/game/network/rail.h
@@ -61,7 +61,9 @@ public:
{
const auto node1 = *nodes.insert(std::make_shared<Node>(a)).first;
const auto node2 = *nodes.insert(std::make_shared<Node>(b)).first;
- return links.create<T>(node1, node2, std::forward<Params>(params)...);
+ auto l = links.create<T>(node1, node2, std::forward<Params>(params)...);
+ joinLinks(l);
+ return l;
}
private:
@@ -70,6 +72,7 @@ private:
Nodes nodes;
void render(const Shader &) const override;
void tick(TickDuration elapsed) override;
+ void joinLinks(LinkPtr) const;
std::shared_ptr<Texture> texture;
};