From 88ae4041eba41136884643ce1c9fef56f37b91ed Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Oct 2020 23:51:54 +0200 Subject: [PATCH] Automatic cleanup of evmenu-template storage --- evennia/utils/evmenu.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 6f9bf37020..84104569c7 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -1064,6 +1064,8 @@ class EvMenu: self.caller.attributes.remove("_menutree_saved_startnode") if self.cmd_on_exit is not None: self.cmd_on_exit(self.caller, self) + # special for template-generated menues + del self.caller.db._evmenu_template_contents def print_debug_info(self, arg): """ @@ -1701,7 +1703,7 @@ def _generated_input_goto_func(caller, raw_string, **kwargs): def _generated_node(caller, raw_string, **kwargs): - text, options = caller.db._generated_menu_contents[kwargs["_current_nodename"]] + text, options = caller.db._evmenu_template_contents[kwargs["_current_nodename"]] return text, options @@ -1803,7 +1805,7 @@ def parse_menu_template(caller, menu_template, goto_callables=None): options = _parse_options(nodename, optiontxt, goto_callables) content_map[nodename] = (text, options) nodetree[nodename] = _generated_node - caller.db._generated_menu_contents = content_map + caller.db._evmenu_template_contents = content_map return nodetree