home · contact · privacy
Fix broken THING_MUSICPLAYER_SETTINGS.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 7 Dec 2020 02:54:19 +0000 (03:54 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 7 Dec 2020 02:54:19 +0000 (03:54 +0100)
plomrogue/commands.py
plomrogue/parser.py

index 373d32931beaa587dc3bd8f453e4274c5fdf6f60..daa43576cd7181ed4e285e3a389abf7dce0b5bbd 100644 (file)
@@ -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)
index 05c830ff8552c216b81924c46244067717e478a4..140637b468aea0982462a9e3a697690ee24c676d 100644 (file)
@@ -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.')