Made EvMenu correctly handle being called from a ServerSession.

This commit is contained in:
Griatch 2015-12-19 19:13:29 +01:00
parent 2427db7f9f
commit f10f4ddc98

View file

@ -194,7 +194,7 @@ class CmdEvMenuNode(Command):
Implement all menu commands. Implement all menu commands.
""" """
caller = self.caller caller = self.caller
menu = caller.ndb._menutree menu = caller.ndb._menutree or self.session.ndb._menutree
if not menu: if not menu:
err = "Menu object not found as %s.ndb._menutree!" % (caller) 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. Initialize the menu tree and start the caller onto the first node.
Args: 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 menudata (str, module or dict): The full or relative path to the module
holding the menu tree data. All global functions in this module holding the menu tree data. All global functions in this module
whose name doesn't start with '_ ' will be parsed as menu nodes. whose name doesn't start with '_ ' will be parsed as menu nodes.