]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
restore flags feature in csqc sound7 builtin, so that mods can use
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 28 Feb 2013 09:46:44 +0000 (09:46 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 21 Mar 2013 16:11:07 +0000 (17:11 +0100)
CHANNELFLAG_FORCELOOP and others as before

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

clvm_cmds.c

index 67a496b9e5a4c9c87852ea47f7312fb6b8827717..e1c6ff0d2a104bea4abea5e3b87bc29883c507d1 100644 (file)
@@ -175,9 +175,7 @@ static void VM_CL_sound (prvm_prog_t *prog)
        float                           attenuation;
        float pitchchange;
        float                           startposition;
-       /*
        int flags;
-       */
        vec3_t                          org;
 
        VM_SAFEPARMCOUNTRANGE(5, 7, VM_CL_sound);
@@ -204,14 +202,11 @@ static void VM_CL_sound (prvm_prog_t *prog)
                pitchchange = 0;
        else
                pitchchange = PRVM_G_FLOAT(OFS_PARM5);
-       // ignoring prog->argc < 7 for now (no flags supported yet)
 
-       /*
        if (prog->argc < 7)
                flags = 0;
        else
                flags = PRVM_G_FLOAT(OFS_PARM6);
-       */
 
        // sound_starttime exists instead of sound_startposition because in a
        // networking sense you might not know when something is being received,
@@ -235,7 +230,7 @@ static void VM_CL_sound (prvm_prog_t *prog)
        // We want to, in a later extension, expose more flags.
 
        CL_VM_GetEntitySoundOrigin(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), org);
-       S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, startposition, 0, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
+       S_StartSound_StartPosition_Flags(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation, startposition, flags, pitchchange > 0.0f ? pitchchange * 0.01f : 1.0f);
 }
 
 // #483 void(vector origin, string sample, float volume, float attenuation) pointsound