From: Christian Heller Date: Mon, 18 Feb 2019 02:14:19 +0000 (+0100) Subject: Fix so-far invisible task name derivation error. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/blog?a=commitdiff_plain;h=ba338f6ed46da5c34fbb7a3e9dac28338a0406a3;p=plomrogue2-experiments Fix so-far invisible task name derivation error. --- 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