]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
changed an error when fighting the end boss of Nehahra to merely a
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 May 2007 13:45:39 +0000 (13:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 May 2007 13:45:39 +0000 (13:45 +0000)
warning, the qc should be fixed though

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

svvm_cmds.c

index 2b936116acc1b5fbc90424019df7866b05f435e4..23a7524e0a4e9a583e5d9856e0d75673474dcbbf 100644 (file)
@@ -435,13 +435,18 @@ static void VM_SV_sound (void)
        int             volume;
        float attenuation;
 
-       VM_SAFEPARMCOUNT(5, VM_SV_sound);
+       VM_SAFEPARMCOUNTRANGE(4, 5, VM_SV_sound);
 
        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);
        attenuation = PRVM_G_FLOAT(OFS_PARM4);
+       if (prog->argc < 5)
+       {
+               Con_DPrintf("VM_SV_sound: given only 4 parameters, expected 5, assuming attenuation = ATTN_NORMAL\n");
+               attenuation = 1;
+       }
 
        if (volume < 0 || volume > 255)
        {