home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71ffa46
)
Enable un-naming of things.
author
Christian Heller
<c.heller@plomlompom.de>
Sat, 12 Dec 2020 23:59:37 +0000
(
00:59
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sat, 12 Dec 2020 23:59:37 +0000
(
00:59
+0100)
plomrogue/commands.py
patch
|
blob
|
history
diff --git
a/plomrogue/commands.py
b/plomrogue/commands.py
index 8ea4ff34a738615c53b65f9349f905e483d39169..026f99603de4b90562c1d4f1d639481a3b3bddaf 100644
(file)
--- a/
plomrogue/commands.py
+++ b/
plomrogue/commands.py
@@
-252,7
+252,13
@@
def cmd_THING_NAME(game, thing_id, name, pw, connection_id):
raise GameError('thing of ID %s not found' % thing_id)
if not game.can_do_thing_with_pw(t, pw):
raise GameError('wrong password for thing')
- t.name = name
+ if name == ' ':
+ if hasattr(t.__class__, 'name'):
+ raise GameError('cannot un-name things of this type')
+ if hasattr(t, 'name'):
+ del t.name
+ else:
+ t.name = name
game.changed = True
# FIXME: pseudo-FOV-change actually
game.record_fov_change(t.position)