From a4e10bde7cdd08e59fa07f76a9c01c71804f7b3a Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 12 Aug 2007 07:26:49 +0000 Subject: [PATCH] fix bug in csqc sound builtin where it multiplied volume by 255 (the sound system already does that) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7523 d7cf8633-e32d-0410-b094-e92efae38249 --- clvm_cmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index d555274c..9e8cbb43 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -130,7 +130,7 @@ static void VM_CL_sound (void) const char *sample; int channel; prvm_edict_t *entity; - int volume; + float volume; float attenuation; VM_SAFEPARMCOUNT(5, VM_CL_sound); @@ -138,10 +138,10 @@ static void VM_CL_sound (void) entity = PRVM_G_EDICT(OFS_PARM0); channel = (int)PRVM_G_FLOAT(OFS_PARM1); sample = PRVM_G_STRING(OFS_PARM2); - volume = (int)(PRVM_G_FLOAT(OFS_PARM3)*255.0f); + volume = PRVM_G_FLOAT(OFS_PARM3); attenuation = PRVM_G_FLOAT(OFS_PARM4); - if (volume < 0 || volume > 255) + if (volume < 0 || volume > 1) { VM_Warning("VM_CL_sound: volume must be in range 0-1\n"); return; -- 2.39.2