Mercurial > games > semicongine
changeset 1019:87da8f6fe70f
add: better assert message
author | sam <sam@basx.dev> |
---|---|
date | Wed, 08 May 2024 15:43:16 +0700 |
parents | 967b8fa81b6b |
children | 355ef428b5f4 |
files | semicongine/audio.nim |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/semicongine/audio.nim Sat Apr 27 22:04:30 2024 +0700 +++ b/semicongine/audio.nim Wed May 08 15:43:16 2024 +0700 @@ -1,4 +1,5 @@ import std/monotimes +import std/strformat import std/times import std/tables import std/locks @@ -77,7 +78,7 @@ mixer.tracks[name] = Track(level: level) proc play*(mixer: var Mixer, soundName: string, track = "", stopOtherSounds = false, loop = false, levelLeft, levelRight: Level): uint64 = - assert track in mixer.tracks + assert track in mixer.tracks, &"Track '{track}' does not exists" assert soundName in mixer.sounds, soundName & " not loaded" mixer.lock.withLock(): if stopOtherSounds: