X-Git-Url: https://plomlompom.com/repos/?p=plomrogue2-experiments;a=blobdiff_plain;f=new%2Fplomrogue%2Ftasks.py;h=c54d0899b98ecb56ec2c4fe422ec357086951df2;hp=6f2f1be9ee4397630059c35eece39ebd48bda99f;hb=f5797c816396a105c0d72cc826c2cc2566f1478c;hpb=4b636feb0fc0bc00f9aa786533a72eea102e6087 diff --git a/new/plomrogue/tasks.py b/new/plomrogue/tasks.py index 6f2f1be..c54d089 100644 --- a/new/plomrogue/tasks.py +++ b/new/plomrogue/tasks.py @@ -37,6 +37,8 @@ class Task_MOVE(Task): def check(self): test_pos = self.thing.world.map_.move(self.thing.position, self.args[0]) + if test_pos is None: + 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: