From f10f4ddc98fbcd26bdb6bc72569cc68b3ece7e76 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Dec 2015 19:13:29 +0100 Subject: [PATCH] Made EvMenu correctly handle being called from a ServerSession. --- evennia/utils/evmenu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 97ee37a2e9..274878b1ed 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -194,7 +194,7 @@ class CmdEvMenuNode(Command): Implement all menu commands. """ caller = self.caller - menu = caller.ndb._menutree + menu = caller.ndb._menutree or self.session.ndb._menutree if not menu: err = "Menu object not found as %s.ndb._menutree!" % (caller) @@ -319,7 +319,7 @@ class EvMenu(object): Initialize the menu tree and start the caller onto the first node. Args: - caller (str): The user of the menu. + caller (Object, Player or Session): The user of the menu. menudata (str, module or dict): The full or relative path to the module holding the menu tree data. All global functions in this module whose name doesn't start with '_ ' will be parsed as menu nodes.