From: Christian Heller Date: Tue, 17 Nov 2020 23:23:06 +0000 (+0100) Subject: Minor refactor. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/test?a=commitdiff_plain;h=f0f0c01c001fef0bdc6bf8d60da329e4c7b55223;p=plomrogue2 Minor refactor. --- diff --git a/plomrogue/commands.py b/plomrogue/commands.py index e40f530..ed7d3dd 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -194,7 +194,7 @@ cmd_MAP_CONTROL_PW.argtypes = 'char string' def cmd_THING(game, yx, thing_type, thing_id): if not thing_type in game.thing_types: raise GameError('illegal thing type %s' % thing_type) - if yx.y < 0 or yx.x < 0 or yx.y >= game.map.size.y or yx.x >= game.map.size.x: + if not game.map.inside(yx): raise GameError('illegal position %s' % yx) t_old = None if thing_id > 0: