Fix play_sound function interpreting -65535 as sound 1.

It now correctly treats it as a sound that doesn't exist,
and plays nothing.
This commit is contained in:
2019-12-01 14:22:39 -05:00
parent 3e6d3b9d5e
commit b8669ac04a
2 changed files with 4 additions and 4 deletions

View File

@@ -61,7 +61,7 @@ void init_snd_tool(){
atexit(exit_snd_tool);
}
void play_sound(short which, sf::Time delay) { // if < 0, play asynch
void play_sound(snd_num_t which, sf::Time delay) { // if < 0, play asynch
static bool inited = false;
if(!inited) {
inited = true;
@@ -104,7 +104,7 @@ void play_sound(short which, sf::Time delay) { // if < 0, play asynch
sf::sleep(time_in_ticks(sound_delay[-1 * which]));
}
void one_sound(short which) {
void one_sound(snd_num_t which) {
if(which == last_played)
return;
play_sound(which);

View File

@@ -13,8 +13,8 @@
void init_snd_tool();
bool sound_going(snd_num_t which_s);
void play_sound(short which, sf::Time delay = sf::Time());
void one_sound(short which);
void play_sound(snd_num_t which, sf::Time delay = sf::Time());
void one_sound(snd_num_t which);
void clear_sound_memory();