git: 9front

Download patch

ref: fed7d8c07d0d34480a1044db991e8e2f731c1620
parent: 4663174570122797083c7c174afc16c966ba3df8
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. */
--