]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
enable offsetmapping permutations only if a normalmap exists and no bias is set
[xonotic/darkplaces.git] / snd_main.c
index e537d8388661b63d0c35345d6ff1568d9ffdff5b..8376007a3a23128409bdd69875cbb8c7759c71ce 100644 (file)
@@ -977,6 +977,15 @@ sfx_t *S_FindName (const char *name)
                if(!strcmp (sfx->name, name))
                        return sfx;
 
+       // check for # in the beginning, try lookup by soundindex
+       if (name[0] == '#' && name[1])
+       {
+               int soundindex = atoi(name + 1);
+               if (soundindex > 0 && soundindex < MAX_SOUNDS)
+                       if (cl.sound_precache[soundindex]->name[0])
+                               return cl.sound_precache[soundindex];
+       }
+
        // Add a sfx_t struct for this sound
        sfx = (sfx_t *)Mem_Alloc (snd_mempool, sizeof (*sfx));
        memset (sfx, 0, sizeof(*sfx));