9front - general discussion about 9front
 help / color / mirror / Atom feed
From: qux <qu7uux@gmail.com>
To: 9front@9front.org
Subject: games/doom: fix unterminated comment causing sound bugs
Date: Sun, 16 Aug 2015 22:58:14 +0300	[thread overview]
Message-ID: <CAAGZaiLrUVJjfj8gWB_7ncDNyFJwPwpV28x_0jRVYzwz9JG4Mw@mail.gmail.com> (raw)

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. */


                 reply	other threads:[~2015-08-16 19:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAGZaiLrUVJjfj8gWB_7ncDNyFJwPwpV28x_0jRVYzwz9JG4Mw@mail.gmail.com \
    --to=qu7uux@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).