home · contact · privacy
Don't generate objects at illegal positions. Plus, refactor.
[plomrogue2-experiments] / new / plomrogue / tasks.py
index c9ce45ed654f1aff64848c65f6b43167db3037c7..dfd22f7d50094d3732a327e370080e1085ef81ca 100644 (file)
@@ -41,8 +41,8 @@ class Task_MOVE(Task):
             raise GameError('would move outside map bounds')
         if self.thing.world.map_[test_pos] != '.':
             raise GameError('%s would move into illegal terrain' % self.thing.id_)
-        for t in self.thing.world.things:
-            if t.blocking and t.position == test_pos:
+        for t in self.thing.world.things_at_pos(test_pos):
+            if t.blocking:
                 raise GameError('%s would move into other thing' % self.thing.id_)
 
     def do(self):