home · contact · privacy
Avoid Thing collisions.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 10 Jan 2019 00:49:46 +0000 (01:49 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 10 Jan 2019 00:49:46 +0000 (01:49 +0100)
server_/game.py

index 878917fbda7711a741c53a981737be741942ffda..66ce62d605bbfda677395a560b819a1e43f4c71d 100644 (file)
@@ -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):