mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 05:57:16 +02:00
Some minor edge-case fixes when using a session as caller.
This commit is contained in:
parent
f12c754225
commit
df74380155
2 changed files with 8 additions and 5 deletions
|
|
@ -434,15 +434,15 @@ class CmdOption(COMMAND_DEFAULT_CLASS):
|
|||
|
||||
if "save" in self.switches:
|
||||
# save all options
|
||||
self.player.db._saved_protocol_flags = flags
|
||||
self.caller.db._saved_protocol_flags = flags
|
||||
self.msg("{gSaved all options. Use @option/clear to remove.{n")
|
||||
if "clear" in self.switches:
|
||||
# clear all saves
|
||||
self.player.db._saved_protocol_flags = {}
|
||||
self.caller.db._saved_protocol_flags = {}
|
||||
self.msg("{gCleared all saved options.")
|
||||
|
||||
options = dict(flags) # make a copy of the flag dict
|
||||
saved_options = dict(self.player.attributes.get("_saved_protocol_flags", default={}))
|
||||
saved_options = dict(self.caller.attributes.get("_saved_protocol_flags", default={}))
|
||||
|
||||
if "SCREENWIDTH" in options:
|
||||
if len(options["SCREENWIDTH"]) == 1:
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class NAttributeHandler(object):
|
|||
"""
|
||||
return key in self._store
|
||||
|
||||
def get(self, key):
|
||||
def get(self, key, default=None):
|
||||
"""
|
||||
Get the named key value.
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ class NAttributeHandler(object):
|
|||
the value of the Nattribute.
|
||||
|
||||
"""
|
||||
return self._store.get(key, None)
|
||||
return self._store.get(key, default)
|
||||
|
||||
def add(self, key, value):
|
||||
"""
|
||||
|
|
@ -376,6 +376,9 @@ class ServerSession(Session):
|
|||
for the protocol(s).
|
||||
|
||||
"""
|
||||
# this can happen if this is triggered e.g. a command.msg
|
||||
# that auto-adds the session, we'd get a kwarg collision.
|
||||
kwargs.pop("session", None)
|
||||
if text is not None:
|
||||
self.data_out(text=text, **kwargs)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue