From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sun, 12 Aug 2007 07:26:49 +0000 (+0000)
Subject: fix bug in csqc sound builtin where it multiplied volume by 255 (the
X-Git-Tag: xonotic-v0.1.0preview~2949
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4e10bde7cdd08e59fa07f76a9c01c71804f7b3a;p=xonotic%2Fdarkplaces.git

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
---

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;