home · contact · privacy
Persist Thing names, simplify their client info display.
[plomrogue2] / plomrogue / commands.py
index 3b2464b42baa6d7c429832ea34138c970d00570d..8732bf3f02eca9ccff649ec98d4316ab7e99153b 100644 (file)
@@ -211,3 +211,10 @@ def cmd_THING(game, yx, thing_type, thing_id):
         game.things += [t_new]
     game.changed = True
 cmd_THING.argtypes = 'yx_tuple:nonneg string:thing_type int:nonneg'
+
+def cmd_THING_NAME(game, thing_id, name):
+    t = game.get_thing(thing_id)
+    if not t:
+        raise GameError('thing of ID %s not found' % thing_id)
+    t.name = name
+cmd_THING_NAME.argtypes = 'int:pos string'