From f68b1eccb0f22fc29e9fb612f65ce9c8b52023c3 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 7 Dec 2020 03:54:19 +0100
Subject: [PATCH] Fix broken THING_MUSICPLAYER_SETTINGS.

---
 plomrogue/commands.py | 2 +-
 plomrogue/parser.py   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

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.')
-- 
2.30.2