From: Christian Heller Date: Wed, 4 Nov 2020 03:42:06 +0000 (+0100) Subject: Whitespace riddance and some quote bug fixes. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/condition?a=commitdiff_plain;h=a75abb6869635e91b9d58ee81bdc1a8622cf5444;p=plomrogue2-experiments Whitespace riddance and some quote bug fixes. --- 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: