Skip to content

Commit

Permalink
Fix god command for console (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
godwhoa committed Jan 12, 2018
1 parent b2a2247 commit 8db974b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions piqueserver/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions piqueserver/core_commands/movement.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8db974b

Please sign in to comment.