9front - general discussion about 9front
 help / color / mirror / Atom feed
* games/doom: fix unterminated comment causing sound bugs
@ 2015-08-16 19:58 qux
  0 siblings, 0 replies; only message in thread
From: qux @ 2015-08-16 19:58 UTC (permalink / raw)
  To: 9front

games/doom: fix unterminated comment causing sound bugs

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).

diff -Naur a/sys/src/games/doom/i_sound.c b/sys/src/games/doom/i_sound.c
--- a/sys/src/games/doom/i_sound.c	Wed Jul 29 13:45:35 2015
+++ b/sys/src/games/doom/i_sound.c	Sun Aug 16 19:38:41 2015
@@ -430,6 +430,7 @@

 	/* Preserve sound SFX id,
 	**  e.g. for avoiding duplicates of chainsaw.
+	*/
 	channelids[slot] = id;

 	/* You tell me. */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-16 19:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-16 19:58 games/doom: fix unterminated comment causing sound bugs qux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).