]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/writebsp.c
Merge commit '7ca7a54fe6db387a22ea979e62ecbbb30f6d6d30' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / writebsp.c
index 4b3e53fe8ce4baaf83cb599da3df60fbcc3511c8..c3262a04fb2129994f944f3209126923edec0fdf 100644 (file)
@@ -56,14 +56,19 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
        /* try to find an existing shader */
        for ( i = 0; i < numBSPShaders; i++ )
        {
-               /* ydnar: handle custom surface/content flags */
+                       /* ydnar: handle custom surface/content flags */
                if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) {
                        continue;
                }
                if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
                        continue;
                }
-
+               if ( !doingBSP ){
+                       si = ShaderInfoForShader( shader );
+                       if ( si->remapShader && si->remapShader[ 0 ] ) {
+                               shader = si->remapShader;
+                       }
+               }
                /* compare name */
                if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) {
                        return i;