From 1c8c25bb65d969ae3feb36ba315d8c589fd81850 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 27 Mar 2009 11:57:59 +0000 Subject: [PATCH] properly let sounds come out of attached entities (currently for svqc only) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8829 d7cf8633-e32d-0410-b094-e92efae38249 --- csprogs.c | 2 ++ snd_main.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/csprogs.c b/csprogs.c index f9d5e7d3..67a7aee1 100644 --- a/csprogs.c +++ b/csprogs.c @@ -953,6 +953,8 @@ qboolean CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out) CSQC_BEGIN; + // FIXME consider attachments here! + ed = PRVM_EDICT_NUM(entnum - 32768); if(!ed->priv.required->free) diff --git a/snd_main.c b/snd_main.c index c4218af8..1675b86d 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1245,9 +1245,10 @@ void SND_Spatialize(channel_t *ch, qboolean isstatic) else if (cl.entities[ch->entnum].state_current.active) { //Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]); - VectorCopy(cl.entities[ch->entnum].state_current.origin, ch->origin); if (cl.entities[ch->entnum].state_current.modelindex && cl.model_precache[cl.entities[ch->entnum].state_current.modelindex] && cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->soundfromcenter) - VectorMAMAM(1.0f, ch->origin, 0.5f, cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->normalmins, 0.5f, cl.model_precache[cl.entities[ch->entnum].state_current.modelindex]->normalmaxs, ch->origin); + VectorMAM(0.5f, cl.entities[ch->entnum].render.mins, 0.5f, cl.entities[ch->entnum].render.maxs, ch->origin); + else + Matrix4x4_OriginFromMatrix(&cl.entities[ch->entnum].render.matrix, ch->origin); } } -- 2.39.2