From: Christian Heller Date: Mon, 7 Dec 2020 02:54:19 +0000 (+0100) Subject: Fix broken THING_MUSICPLAYER_SETTINGS. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/add_task?a=commitdiff_plain;h=f68b1eccb0f22fc29e9fb612f65ce9c8b52023c3;p=plomrogue2 Fix broken THING_MUSICPLAYER_SETTINGS. --- diff --git a/plomrogue/commands.py b/plomrogue/commands.py index 373d329..daa4357 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -285,7 +285,7 @@ def cmd_THING_MUSICPLAYER_SETTINGS(game, thing_id, playing, index, repeat): t.playing = playing t.playlist_index = index t.repeat = repeat -cmd_THING_MUSICPLAYER_SETTINGS.argtypes = 'int:pos bool int:nonneg bool' +cmd_THING_MUSICPLAYER_SETTINGS.argtypes = 'int:pos bool int bool' def cmd_THING_MUSICPLAYER_PLAYLIST_ITEM(game, thing_id, title, length): t = game.get_thing(thing_id) diff --git a/plomrogue/parser.py b/plomrogue/parser.py index 05c830f..140637b 100644 --- a/plomrogue/parser.py +++ b/plomrogue/parser.py @@ -127,6 +127,11 @@ class Parser: if not arg.isdigit() or int(arg) < 1: raise ArgError('Argument must be positive integer.') args += [int(arg)] + elif tmpl == 'int': + try: + args += [int(arg)] + except ValueError: + raise ArgError('Argument must be integer.') elif tmpl == 'bool': if not arg.isdigit() or int(arg) not in (0, 1): raise ArgError('Argument must be 0 or 1.')