ref: 0d76dafaa023ec68abae9e92961e6619397c76e6
parent: 8c3acde2def299eebbb9eaf59d075a84b5dab131
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Aug 16 18:07:12 EDT 2015
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).
--- a/sys/src/games/doom/i_sound.c
+++ b/sys/src/games/doom/i_sound.c
@@ -430,6 +430,7 @@
/* Preserve sound SFX id,
** e.g. for avoiding duplicates of chainsaw.
+ */
channelids[slot] = id;
/* You tell me. */