]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix bug in csqc sound builtin where it multiplied volume by 255 (the
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Aug 2007 07:26:49 +0000 (07:26 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 12 Aug 2007 07:26:49 +0000 (07:26 +0000)
sound system already does that)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7523 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c

index d555274c91db33d6eeeed4f4a15bef145b3fb490..9e8cbb430877ddbf74783cd1429a0a79d1a6854d 100644 (file)
@@ -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;