Skip to content

Commit

Permalink
Fix wolf getting stuck if sound missing (fixes #865)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Dec 2, 2024
1 parent b61b47d commit 336a613
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/cdogs/map_wolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,17 +891,16 @@ static void LoadSounds(const SoundDevice *s, const CWolfMap *map)
while (name != NULL)
{
Mix_Chunk *data = LoadSoundData(map, i);
if (data == NULL)
if (data != NULL)
{
continue;
}
if (name[strlen(name) - 1] == '/')
{
AddRandomSound(s, name, data);
}
else
{
AddNormalSound(s, name, data);
if (name[strlen(name) - 1] == '/')
{
AddRandomSound(s, name, data);
}
else
{
AddNormalSound(s, name, data);
}
}
name = strtok(NULL, "|");
}
Expand Down

0 comments on commit 336a613

Please sign in to comment.