From e5aa10df83e8d6ceab53d628af91655cb9680a10 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 23 Aug 2021 15:56:45 +0200 Subject: [PATCH] move_to function --- devmods/rulegen-tests.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/devmods/rulegen-tests.cpp b/devmods/rulegen-tests.cpp index 12d9d46f..c1293a0a 100644 --- a/devmods/rulegen-tests.cpp +++ b/devmods/rulegen-tests.cpp @@ -159,6 +159,17 @@ void irradiate() { cleanup_protomap(); } +void move_to(cellwalker cw) { + cwt = cw; + centerover = cwt.at; + View = Id; + } + +void move_to(twalker dw) { + auto m = dynamic_cast (currentmap); + move_to(cellwalker(m->clone(dw.at)->c7, dw.spin, dw.mirrored)); + } + void debug_menu() { cmode = sm::SIDE | sm::MAYDARK; gamescreen(0); @@ -216,10 +227,8 @@ void debug_menu() { dialog::init(); for(auto dw: debuglist) { dialog::addItem("go to " + index_pointer(dw.at), 'a'); - dialog::add_action([dw,m] { - cwt = cellwalker(m->clone(dw.at)->c7, dw.spin, dw.mirrored); - centerover = cwt.at; - View = Id; + dialog::add_action([dw] { + move_to(dw); }); } dialog::display();