]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix sound spatialization of edited sounds
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Nov 2009 06:36:19 +0000 (06:36 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Nov 2009 06:36:19 +0000 (06:36 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9512 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
snd_main.c

index e10ab54dc89a9ef8d62b7d7d88b842136ba08ea7..b2a4f3cdbb3921148b3e4a77092e55c10149033e 100644 (file)
@@ -162,6 +162,7 @@ static void VM_CL_sound (void)
        prvm_edict_t            *entity;
        float                           volume;
        float                           attenuation;
+       vec3_t                          org;
 
        VM_SAFEPARMCOUNT(5, VM_CL_sound);
 
@@ -189,7 +190,8 @@ static void VM_CL_sound (void)
                return;
        }
 
-       S_StartSound(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), entity->fields.client->origin, volume, attenuation);
+       CL_VM_GetEntitySoundOrigin(PRVM_NUM_FOR_EDICT(entity), org);
+       S_StartSound(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation);
 }
 
 // #483 void(vector origin, string sample, float volume, float attenuation) pointsound
index 9be23f2b30a331562557e743f6109b066ed60b43..fdb0c7391999ea0f4070505dd6b55caf4652631d 100644 (file)
@@ -1466,7 +1466,8 @@ int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
                        if (ch->entnum == entnum && (ch->entchannel == entchannel || entchannel == -1) )
                        {
                                S_SetChannelVolume(ch_idx, fvol);
-                               ch->dist_mult = attenuation / (64.0f * snd_soundradius.value);
+                               ch->dist_mult = attenuation / snd_soundradius.value;
+                               SND_Spatialize(ch_idx, false);
                                return ch_idx;
                        }
                }