home · contact · privacy
Fix so-far invisible task name derivation error.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 18 Feb 2019 02:14:19 +0000 (03:14 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 18 Feb 2019 02:14:19 +0000 (03:14 +0100)
new/plomrogue/commands.py
new/plomrogue/tasks.py

index aa3253ae8520a46b12fa63364de1a73f5bcd15ea..87afd605314847da0395249704f94611e73edcfe 100644 (file)
@@ -67,7 +67,9 @@ def cmd_SAVE(game):
             task = thing.task
             if task is not None:
                 task_args = task.get_args_string()
-                write(f, 'SET_TASK:%s %s %s %s' % (task.name, thing.id_,
+                task_name = [k for k in game.tasks.keys()
+                             if game.tasks[k] == task.__class__][0]
+                write(f, 'SET_TASK:%s %s %s %s' % (task_name, thing.id_,
                                                    task.todo, task_args))
         write(f, 'PLAYER_ID %s' % game.world.player_id)
 cmd_SAVE.dont_save = True
index a2c041b06aeb0807ab095f3f07f914ea705e26f2..fe41e419ca32fba8961823dcada0572e95a9e651 100644 (file)
@@ -11,12 +11,6 @@ class Task:
         self.args = args
         self.todo = 3
 
-    @property
-    def name(self):
-        prefix = 'Task_'
-        class_name = self.__class__.__name__
-        return class_name[len(prefix):]
-
     def check(self):
         pass