Index: tools/quake3/q3map2/writebsp.c
===================================================================
--- tools/quake3/q3map2/writebsp.c	(revision 193)
+++ tools/quake3/q3map2/writebsp.c	(working copy)
@@ -452,7 +452,10 @@
 		if( numBrushes != NULL )
 			(*numBrushes)++;
 		
-		db->shaderNum = EmitShader( b->contentShader->shader, &b->contentShader->contentFlags, &b->contentShader->surfaceFlags );
+/* hrehfeld make it use the brushes contentFlags*/
+/* todo 2009-02-22 13:57 hrehfeld    someone who knows the codebase should check if we never have wrong info in brush->contentFlags. I think it is a copy of shaderInfo->contentFlags, but why isn't it used in the first place? */
+/* old code:		db->shaderNum = EmitShader( b->contentShader->shader, &b->contentShader->contentFlags, &b->contentShader->surfaceFlags );*/
+		db->shaderNum = EmitShader( b->contentShader->shader, &b->contentFlags, &b->contentShader->surfaceFlags );
 		db->firstSide = numBSPBrushSides;
 		
 		/* walk sides */
Index: tools/quake3/q3map2/map.c
===================================================================
--- tools/quake3/q3map2/map.c	(revision 193)
+++ tools/quake3/q3map2/map.c	(working copy)
@@ -1421,6 +1421,8 @@
 	parseMesh_t		*patch;
 	qboolean		funcGroup;
 	int				castShadows, recvShadows;
+	/* hrehfeld */
+	int				nonsolid = 0;
 	
 	
 	/* eof check */
@@ -1550,7 +1552,21 @@
 	
 	/* get explicit shadow flags */
 	GetEntityShadowFlags( mapEnt, NULL, &castShadows, &recvShadows );
-	
+
+	/* hrehfeld
+	   add nonsolid flag support to entities
+	*/
+	{
+		const char *nsolid = ValueForKey( mapEnt, "nonsolid" );
+		nonsolid = atoi(nsolid);
+
+		/* debug printing */
+		if (nonsolid > 0)
+		{
+			Sys_Printf( "Entity %d (%s) is nonsolid: %d\n", mapEnt->mapEntityNum, classname, nonsolid );
+		}
+	}
+
 	/* ydnar: get lightmap scaling value for this entity */
 	if( strcmp( "", ValueForKey( mapEnt, "lightmapscale" ) ) ||
 		strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) )
@@ -1586,6 +1602,12 @@
 		brush->recvShadows = recvShadows;
 		brush->lightmapScale = lightmapScale;
 		brush->celShader = celShader;
+
+		/* hrehfeld set brush contents to what equals nonsolid in the game */
+		if (nonsolid > 0)
+		{
+			ApplySurfaceParm( "nonsolid", &(brush->contentFlags), NULL, &(brush->compileFlags) );
+		}
 	}
 	
 	for( patch = mapEnt->patches; patch != NULL; patch = patch->next )

