Add hurt sounds, fix sound playing
This commit is contained in:
@@ -27,7 +27,7 @@ bool soundsPlay(SoundState *sounds, SoundType type) {
|
||||
|
||||
i32 freeSlot = -1;
|
||||
for (i32 i = 0; i < SOUND_MAX_PLAYING; i++) {
|
||||
if (IsSoundPlaying(sounds->playing[i])) {
|
||||
if (!IsSoundPlaying(sounds->playing[i])) {
|
||||
freeSlot = i;
|
||||
break;
|
||||
}
|
||||
@@ -36,6 +36,7 @@ bool soundsPlay(SoundState *sounds, SoundType type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sounds->playing[freeSlot] = sounds->sounds[type];
|
||||
PlaySound(sounds->playing[freeSlot]);
|
||||
SetSoundVolume(sounds->playing[freeSlot], sounds->soundVolume);
|
||||
sounds->soundLastPlayed[type] = time;
|
||||
|
||||
Reference in New Issue
Block a user