From 74719f2cbdccc8ba5341112cbf71ccc49e673772 Mon Sep 17 00:00:00 2001 From: Allanis Date: Tue, 31 Dec 2013 03:28:20 +0000 Subject: [PATCH] [Fix] Fixed linked list for sound, was hanging the entire thing.. --- src/input.c | 2 +- src/sound.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/input.c b/src/input.c index ee2b837..32307eb 100644 --- a/src/input.c +++ b/src/input.c @@ -74,7 +74,7 @@ void input_setDefault(void) { input_setKeybind("target_hostile", KEYBIND_KEYBOARD, SDLK_r, KMOD_NONE, 0); /* Combat. */ input_setKeybind("primary", KEYBIND_KEYBOARD, SDLK_SPACE, KMOD_NONE, 0); - input_setKeybind("face", KEYBIND_KEYBOARD, SDLK_f, KMOD_NONE, 0); + input_setKeybind("face", KEYBIND_KEYBOARD, SDLK_1, KMOD_NONE, 0); input_setKeybind("board", KEYBIND_KEYBOARD, SDLK_b, KMOD_NONE, 0); /* Escorts. */ input_setKeybind("e_attack", KEYBIND_KEYBOARD, SDLK_f, KMOD_NONE, 0); diff --git a/src/sound.c b/src/sound.c index ee6d59e..40eddd9 100644 --- a/src/sound.c +++ b/src/sound.c @@ -502,7 +502,6 @@ static Mix_Chunk* sound_load(char* filename) { /* Get the file data buffer from the packfile. */ wavdata = pack_readfile(DATA, filename, &size); - rw = SDL_RWFromMem(wavdata, size); /* Bind to OpenAL buffer. */ @@ -676,9 +675,11 @@ static int voice_add(alVoice* v) { tv = v->prev; tv->next = v->next; if(tv->next != NULL) - voice_pool->prev = NULL; + tv->next->prev = tv; } else { /* Set pool to be the next. */ voice_pool = v->next; + if(voice_pool != NULL) + voice_pool->prev = NULL; } /* Insert to the front of active voices. */