home · contact · privacy
Server/py: Fix buggy logging in actor_use().
authorChristian Heller <c.heller@plomlompom.de>
Sat, 7 Mar 2015 23:42:08 +0000 (00:42 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 7 Mar 2015 23:42:08 +0000 (00:42 +0100)
plomrogue-server.py

index 2b65287478bdfd3f462974d97e11ae341600fc8a..2d53bb56fdea150011f046a68c1d798a88e4831a 100755 (executable)
@@ -668,13 +668,15 @@ def actor_use(t):
             t["T_CARRIES"].remove(id)
             del world_db["Things"][id]
             t["T_SATIATION"] += world_db["ThingTypes"][type]["TT_CONSUMABLE"]
-            strong_write(io_db["file_out"], "LOG You consume this object.\n")
-        else:
-            strong_write(io_db["file_out"], "LOG You try to use this object," +
-                                            "but fail.\n")
-    else:
-        strong_write(io_db["file_out"], "LOG You try to use an object, but " +
-                                        "you own none.\n")
+            if t == world_db["Things"][0]:
+                strong_write(io_db["file_out"],
+                             "LOG You consume this object.\n")
+        elif t == world_db["Things"][0]:
+            strong_write(io_db["file_out"],
+                         "LOG You try to use this object, but fail.\n")
+    elif t == world_db["Things"][0]:
+        strong_write(io_db["file_out"],
+                     "LOG You try to use an object, but you own none.\n")
 
 
 def thingproliferation(t):