From: Christian Heller Date: Thu, 10 Jan 2019 00:49:46 +0000 (+0100) Subject: Avoid Thing collisions. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/process_titles?a=commitdiff_plain;h=54019ea9f12da4e51a25d52f5f89a1668967363d;p=plomrogue2-experiments Avoid Thing collisions. --- diff --git a/server_/game.py b/server_/game.py index 878917f..66ce62d 100644 --- a/server_/game.py +++ b/server_/game.py @@ -79,6 +79,9 @@ class Task: map_tile = self.thing.world.terrain_map[pos_i] if map_tile != '.': raise GameError('would move into illegal terrain') + for t in self.thing.world.things: + if t.position == test_pos: + raise GameError('would move into other thing') class Thing(game_common.Thing):