X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomrogue%2Fcommands.py;h=026f99603de4b90562c1d4f1d639481a3b3bddaf;hb=7fc75c298c5e54159bc86d5841ee9feab2fc64d0;hp=8ea4ff34a738615c53b65f9349f905e483d39169;hpb=71ffa4676857da80edebbbfca6e2910d929ee3a5;p=plomrogue2 diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 8ea4ff3..026f996 100644 --- 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)