]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
restrict which CHANNELFLAG_ values can be used in sound7 builtin, to
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Mar 2013 01:59:37 +0000 (01:59 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Mar 2013 01:59:37 +0000 (01:59 +0000)
keep qc from using internal-only ones

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

clvm_cmds.c
svvm_cmds.c

index 7cde1d918105e872bd7d34773e1fb507dfd9d063..04d03a9bc660684b5e8107c3535a966939016bc6 100644 (file)
@@ -206,7 +206,10 @@ static void VM_CL_sound (prvm_prog_t *prog)
        if (prog->argc < 7)
                flags = 0;
        else
-               flags = PRVM_G_FLOAT(OFS_PARM6);
+       {
+               // LordHavoc: we only let the qc set certain flags, others are off-limits
+               flags = (int)PRVM_G_FLOAT(OFS_PARM6) & (CHANNELFLAG_RELIABLE | CHANNELFLAG_FORCELOOP | CHANNELFLAG_PAUSED);
+       }
 
        // sound_starttime exists instead of sound_startposition because in a
        // networking sense you might not know when something is being received,
index c13608dedd5c6d92140b986c5daefa437a45a826..e9d51fdf75df165ac94bd4f451447b1c88067e61 100644 (file)
@@ -554,7 +554,10 @@ static void VM_SV_sound(prvm_prog_t *prog)
                }
        }
        else
-               flags = PRVM_G_FLOAT(OFS_PARM6);
+       {
+               // LordHavoc: we only let the qc set certain flags, others are off-limits
+               flags = (int)PRVM_G_FLOAT(OFS_PARM6) & (CHANNELFLAG_RELIABLE | CHANNELFLAG_FORCELOOP | CHANNELFLAG_PAUSED);
+       }
 
        if (volume < 0 || volume > 255)
        {