From 13e6460ff3a43e39dcd1af236e63f3c95d9d47e4 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Sat, 1 Oct 2016 16:51:25 +0200 Subject: [PATCH] set lastmenu during execution of menuinit script --- source/src/menus.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 9bebaf3b..fcd776cd 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -1309,7 +1309,13 @@ void gmenu::open() if(!allowinput) menusel = 0; if(!forwardkeys) player1->stopmoving(); setcontext("menu", name); - if(initaction) execute(initaction); + if(initaction) + { + gmenu *oldlastmenu = lastmenu; + lastmenu = this; + execute(initaction); + lastmenu = oldlastmenu; + } if(items.inrange(menusel)) items[menusel]->focus(true); init(); resetcontext();