From 6a42c14f0f393f8866689e3b19e950cdc299938b Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 8 Nov 2020 02:16:16 +0100
Subject: [PATCH] Add thing collision detection on movement.

---
 new2/plomrogue/tasks.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/new2/plomrogue/tasks.py b/new2/plomrogue/tasks.py
index bb78b98..99bb41f 100644
--- a/new2/plomrogue/tasks.py
+++ b/new2/plomrogue/tasks.py
@@ -36,6 +36,8 @@ class Task_MOVE(Task):
         test_pos = self.get_move_target()
         if test_pos is None:
             raise PlayError('would move out of map')
+        elif test_pos in [t.position for t in self.thing.game.things]:
+            raise PlayError('would collide with other things')
         elif self.thing.game.map[test_pos] != '.':
             raise PlayError('would move into illegal territory')
 
-- 
2.30.2