From 2e19c2d71238e6f38bd56c3ddaf08a384aa2e2b8 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 7 Oct 2023 16:07:43 +0200 Subject: [PATCH] tools/zep_dispatch: topogen: place first node at origin --- dist/tools/zep_dispatch/topogen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/tools/zep_dispatch/topogen.c b/dist/tools/zep_dispatch/topogen.c index 293624ed6e..171888dfd7 100644 --- a/dist/tools/zep_dispatch/topogen.c +++ b/dist/tools/zep_dispatch/topogen.c @@ -113,6 +113,12 @@ static void world_gen(struct world *w, unsigned num_nodes, node_generate(&w->nodes[i], w, random_range(range - var, range + var), i); node_name(&w->nodes[i], i); } + + if (!w->grid) { + /* place first node at origin */ + w->nodes[0].x = 0; + w->nodes[0].y = 0; + } } static unsigned _color(const struct node *n, unsigned base)