-from plomrogue.errors import GameError
+from plomrogue.errors import PlayError
from plomrogue.mapping import YX
def check(self):
test_pos = self.get_move_target()
if test_pos is None:
- raise GameError('would move out of map')
+ 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 GameError('would move into illegal territory')
+ raise PlayError('would move into illegal territory')
def do(self):
self.thing.position = self.get_move_target()