Merge pull request #2037 from volundmush/fix_cmd_width
Fixing error with Command.client_width()
This commit is contained in:
commit
a43fef23e5
1 changed files with 3 additions and 3 deletions
|
|
@ -502,13 +502,13 @@ Command {self} has no defined `func()` - showing on-command variables:
|
||||||
Get the client screenwidth for the session using this command.
|
Get the client screenwidth for the session using this command.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
client width (int or None): The width (in characters) of the client window. None
|
client width (int): The width (in characters) of the client window.
|
||||||
if this command is run without a Session (such as by an NPC).
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if self.session:
|
if self.session:
|
||||||
return self.session.protocol_flags.get(
|
return self.session.protocol_flags.get(
|
||||||
"SCREENWIDTH", (settings.CLIENT_DEFAULT_WIDTH, ))[0]
|
"SCREENWIDTH", {0: settings.CLIENT_DEFAULT_WIDTH})[0]
|
||||||
|
return settings.CLIENT_DEFAULT_WIDTH
|
||||||
|
|
||||||
def styled_table(self, *args, **kwargs):
|
def styled_table(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue