From 8db974b9f2744c368f49e5c3b0525c10ee8cbe08 Mon Sep 17 00:00:00 2001 From: Joseph Daniel Date: Sat, 13 Jan 2018 00:31:35 +0530 Subject: [PATCH] Fix god command for console (#263) --- piqueserver/commands.py | 4 ++-- piqueserver/core_commands/movement.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/piqueserver/commands.py b/piqueserver/commands.py index 976ab257e..6c87acdb5 100644 --- a/piqueserver/commands.py +++ b/piqueserver/commands.py @@ -373,9 +373,9 @@ def handle_command(connection, command, parameters): # make an attempt at displaying them nicely in format_command_error except KeyError: msg = None # 'Invalid command' - except TypeError as t: + except TypeError: print('Command', command, 'failed with args:', parameters) - traceback.print_exc(t) + traceback.print_exc() msg = 'Command failed' except CommandError as e: msg = str(e) diff --git a/piqueserver/core_commands/movement.py b/piqueserver/core_commands/movement.py index 709e8a380..40d09dfc3 100644 --- a/piqueserver/core_commands/movement.py +++ b/piqueserver/core_commands/movement.py @@ -1,5 +1,5 @@ from pyspades.common import (coordinates, to_coordinates) -from piqueserver.commands import command, get_player +from piqueserver.commands import command, CommandError, get_player @command(admin_only=True) @@ -186,10 +186,10 @@ def god(connection, player=None): Go into god mode and inform everyone on the server of it /god [player] """ - if player is not None: + if player: connection = get_player(connection.protocol, player) elif connection not in connection.protocol.players: - return 'Unknown player: ' + player + return 'Unknown player' connection.god = not connection.god # toggle godmode