shithub: riscv

Download patch

ref: ca8ca008f4ab7074971a35e08de9a46cb9b5d5ab
parent: dab539cd14726de15932b0310532212f8da29bf7
author: cinap_lenrek <[email protected]>
date: Thu Jun 30 13:13:47 EDT 2016

doom: fix blazing door sounds (from qu7uux)

blazing doors are a "fast" door type with its own sound effects, introduced in
doom2. doom2 map 2 has one right at the beginning.

this fixes two bugs:
- when a closing blazing door is completely shut, the closing sound effect is
  erroneously played again (the first time being when it began closing). this
  gives the impression of two doors closing.
- when reopening a closing blazing door (standing underneath a blazing door
  while it's closing), the sound effect for regular doors opening is played,
  instead of the one for blazing doors, because of a missing case in the switch
  statement.

--- a/sys/src/games/doom/p_doors.c
+++ b/sys/src/games/doom/p_doors.c
@@ -115,12 +115,6 @@
 	    {
 	      case BlazeRaise:
 	      case BlazeClose:
-		door->sector->specialdata = NULL;
-		P_RemoveThinker (&door->thinker);  // unlink and free
-		S_StartSound((mobj_t *)&door->sector->soundorg,
-			     sfx_bdcls);
-		break;
-		
 	      case Normal:
 	      case Close:
 		door->sector->specialdata = NULL;
@@ -143,7 +137,13 @@
 	      case BlazeClose:
 	      case Close:		// DO NOT GO BACK UP!
 		break;
-		
+
+	      case BlazeRaise:
+		door->direction = 1;
+		S_StartSound((mobj_t *)&door->sector->soundorg,
+			     sfx_bdopn);
+		break;
+
 	      default:
 		door->direction = 1;
 		S_StartSound((mobj_t *)&door->sector->soundorg,