]> 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)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 21 Mar 2013 16:11:11 +0000 (17:11 +0100)
keep qc from using internal-only ones

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11924 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=1072f6b15ea55174cccdcc1c2da6cd6c37784e07

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 ec7eac412094cd79b96a98ed89445599b20021b9..73394e9975b943bd64d3c30bf9e77fdbc443d1e2 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)
        {