]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/model.c
misc_model: also support _skin name; also support frame field name
[xonotic/netradiant.git] / tools / quake3 / q3map2 / model.c
index 86a87c424fff6fa675fc6d3c777129e4ff80ec19..2b3bb7ed5f0059d5c1cc18862c65e47517b36f08 100644 (file)
@@ -747,7 +747,11 @@ void AddTriangleModels( entity_t *e )
                }
                
                /* get model frame */
-               frame = IntForKey( e2, "_frame" );
+               frame = 0;
+               if(strcmp("", ValueForKey( e2, "_frame")))
+                       frame = IntForKey(e2, "_frame");
+               else if(strcmp("", ValueForKey( e2, "frame")))
+                       frame = IntForKey(e2, "frame");
                
                /* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */
                if( e == entities )
@@ -888,7 +892,11 @@ void AddTriangleModels( entity_t *e )
                if( shadeAngle > 0.0f )
                        Sys_Printf( "misc_model has shading angle of %.4f\n", shadeAngle );
 
-               skin = IntForKey(e2, "skin");
+               skin = 0;
+               if(strcmp("", ValueForKey( e2, "_skin")))
+                       skin = IntForKey(e2, "_skin");
+               else if(strcmp("", ValueForKey( e2, "skin")))
+                       skin = IntForKey(e2, "skin");
 
                /* insert the model */
                InsertModel( model, skin, frame, transform, remap, celShader, mapEntityNum, castShadows, recvShadows, spawnFlags, lightmapScale, lightmapSampleSize, shadeAngle );