summaryrefslogtreecommitdiff
path: root/src/hexen
diff options
context:
space:
mode:
authorSimon Howard2010-02-06 15:54:13 +0000
committerSimon Howard2010-02-06 15:54:13 +0000
commitc33c1fa07680ef07540fb1c48a323bdc816e3e77 (patch)
tree13adc41cd9dda55b1cb3d10993d3e5c4a4c0b7bd /src/hexen
parent52f81b4ef175358d1e1f7f9eecab2a1edb7f4b65 (diff)
downloadchocolate-doom-c33c1fa07680ef07540fb1c48a323bdc816e3e77.tar.gz
chocolate-doom-c33c1fa07680ef07540fb1c48a323bdc816e3e77.tar.bz2
chocolate-doom-c33c1fa07680ef07540fb1c48a323bdc816e3e77.zip
Fix Heretic/Hexen "noise" sound debug cheats.
Subversion-branch: /branches/raven-branch Subversion-revision: 1850
Diffstat (limited to 'src/hexen')
-rw-r--r--src/hexen/s_sound.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/hexen/s_sound.c b/src/hexen/s_sound.c
index fdd01ba5..74774fb3 100644
--- a/src/hexen/s_sound.c
+++ b/src/hexen/s_sound.c
@@ -787,8 +787,16 @@ void S_GetChannelInfo(SoundInfo_t * s)
c->priority = Channel[i].priority;
c->name = S_sfx[c->id].name;
c->mo = Channel[i].mo;
- c->distance = P_AproxDistance(c->mo->x - viewx, c->mo->y - viewy)
- >> FRACBITS;
+
+ if (c->mo != NULL)
+ {
+ c->distance = P_AproxDistance(c->mo->x - viewx, c->mo->y - viewy)
+ >> FRACBITS;
+ }
+ else
+ {
+ c->distance = 0;
+ }
}
}