From ba338f6ed46da5c34fbb7a3e9dac28338a0406a3 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 18 Feb 2019 03:14:19 +0100 Subject: [PATCH] Fix so-far invisible task name derivation error. --- new/plomrogue/commands.py | 4 +++- new/plomrogue/tasks.py | 6 ------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/new/plomrogue/commands.py b/new/plomrogue/commands.py index aa3253a..87afd60 100644 --- a/new/plomrogue/commands.py +++ b/new/plomrogue/commands.py @@ -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 diff --git a/new/plomrogue/tasks.py b/new/plomrogue/tasks.py index a2c041b..fe41e41 100644 --- a/new/plomrogue/tasks.py +++ b/new/plomrogue/tasks.py @@ -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 -- 2.30.2