From 0d76dafaa023ec68abae9e92961e6619397c76e6 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 16 Aug 2015 22:07:12 +0200 Subject: games/doom: fix unterminated comment causing sound bugs (from qu7uux) this bug was introduced in the plan9 port, and since i_sound.c compiles with no warning, it was never noticed. in effect, the statement between the unterminated comment and the next is ignored. channelids[] is used in addsfx() to avoid re-adding certain sounds if they are already playing. one of those is sfx_sawful, and because of this bug, it is added again each tic during which the player fires the chainsaw, rather than reset every tic. compare firing the chainsaw continuously with and without the patch (without hitting an enemy). --- sys/src/games/doom/i_sound.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/src/games/doom/i_sound.c b/sys/src/games/doom/i_sound.c index 54771728a..5ff4715cd 100644 --- a/sys/src/games/doom/i_sound.c +++ b/sys/src/games/doom/i_sound.c @@ -430,6 +430,7 @@ addsfx(int id, int vol, int step, int sep) /* Preserve sound SFX id, ** e.g. for avoiding duplicates of chainsaw. + */ channelids[slot] = id; /* You tell me. */ -- cgit v1.2.3