From c33c1fa07680ef07540fb1c48a323bdc816e3e77 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 6 Feb 2010 15:54:13 +0000 Subject: Fix Heretic/Hexen "noise" sound debug cheats. Subversion-branch: /branches/raven-branch Subversion-revision: 1850 --- src/heretic/s_sound.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/heretic/s_sound.c') diff --git a/src/heretic/s_sound.c b/src/heretic/s_sound.c index bdd24594..be4ae0e3 100644 --- a/src/heretic/s_sound.c +++ b/src/heretic/s_sound.c @@ -550,8 +550,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; + } } } -- cgit v1.2.3