From a75abb6869635e91b9d58ee81bdc1a8622cf5444 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 4 Nov 2020 04:42:06 +0100 Subject: [PATCH] Whitespace riddance and some quote bug fixes. --- new2/plomrogue/game.py | 7 +++---- new2/plomrogue/things.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/new2/plomrogue/game.py b/new2/plomrogue/game.py index 2202343..c89d2c6 100755 --- a/new2/plomrogue/game.py +++ b/new2/plomrogue/game.py @@ -6,7 +6,7 @@ from plomrogue.commands import (cmd_ALL, cmd_LOGIN, cmd_QUERY, cmd_PING, cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE) from plomrogue.io import GameIO from plomrogue.misc import quote -from plomrogue.things import Thing, ThingPlayer +from plomrogue.things import Thing, ThingPlayer from plomrogue.mapping import YX, MapGeometrySquare, Map @@ -14,7 +14,6 @@ from plomrogue.mapping import YX, MapGeometrySquare, Map class GameBase: def __init__(self): - pass self.turn = 0 self.things = [] @@ -87,7 +86,7 @@ class Game(GameBase): def send_thing(thing): self.io.send('THING_POS %s %s' % (thing.id_, t.position)) if hasattr(thing, 'nickname'): - self.io.send('THING_NAME %s %s' % (thing.id_, t.nickname)) + self.io.send('THING_NAME %s %s' % (thing.id_, quote(t.nickname))) self.io.send('TURN ' + str(self.turn)) @@ -95,7 +94,7 @@ class Game(GameBase): send_thing(t) self.io.send('MAP %s %s' % (self.map_geometry.size, quote(self.map.terrain))) for yx in self.portals: - self.io.send('PORTAL %s %s' % (yx, self.portals[yx])) + self.io.send('PORTAL %s %s' % (yx, quote(self.portals[yx]))) self.io.send('GAME_STATE_COMPLETE') def run_tick(self): diff --git a/new2/plomrogue/things.py b/new2/plomrogue/things.py index 138a1fa..0e4af34 100644 --- a/new2/plomrogue/things.py +++ b/new2/plomrogue/things.py @@ -40,7 +40,7 @@ class ThingAnimate(Thing): def set_next_task(self, task_name, args=()): task_class = self.game.tasks[task_name] - self.next_tasks += [task_class(self, args)] + self.next_tasks += [task_class(self, args)] def get_next_task(self): if len(self.next_tasks) > 0: -- 2.30.2