Fixed bgm stopping order if BGM not found (should first stop existing BGM, and then free its resources).

This commit is contained in:
makise-homura 2017-01-31 01:02:03 +03:00
parent 0ad5a46c75
commit 319d844b7a

View file

@ -134,9 +134,9 @@ void start_bgm(char *name) {
if((current_bgm.data = get_snd(resources.music, name)) == NULL)
{
warnx("start_bgm():\n!- BGM '%s' not exist", current_bgm.name);
stop_bgm();
free(current_bgm.name);
current_bgm.name = NULL;
stop_bgm();
return;
}
alSourceRewind(resources.bgmsrc);