From 54019ea9f12da4e51a25d52f5f89a1668967363d Mon Sep 17 00:00:00 2001 From: Christian Heller <c.heller@plomlompom.de> Date: Thu, 10 Jan 2019 01:49:46 +0100 Subject: [PATCH] Avoid Thing collisions. --- server_/game.py | 3 +++ 1 file changed, 3 insertions(+) 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): -- 2.30.2