From: Rudolf Polzer Date: Sun, 5 Jun 2011 16:43:31 +0000 (+0200) Subject: fix a possible bug that can cause ds->shaderInfo to be NULL X-Git-Tag: xonotic-v0.5.0~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bbce294abbd240183a5c44edc02c0c2d32408389;p=xonotic%2Fnetradiant.git fix a possible bug that can cause ds->shaderInfo to be NULL --- diff --git a/tools/quake3/q3map2/model.c b/tools/quake3/q3map2/model.c index a56134c8..c4d34d71 100644 --- a/tools/quake3/q3map2/model.c +++ b/tools/quake3/q3map2/model.c @@ -333,12 +333,6 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap if( PicoGetSurfaceType( surface ) != PICO_TRIANGLES ) continue; - /* allocate a surface (ydnar: gs mods) */ - ds = AllocDrawSurface( SURFACE_TRIANGLES ); - ds->entityNum = eNum; - ds->castShadows = castShadows; - ds->recvShadows = recvShadows; - /* get shader name */ shader = PicoGetSurfaceShader( surface ); if( shader == NULL ) @@ -401,6 +395,12 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap else si = ShaderInfoForShader( picoShaderName ); + /* allocate a surface (ydnar: gs mods) */ + ds = AllocDrawSurface( SURFACE_TRIANGLES ); + ds->entityNum = eNum; + ds->castShadows = castShadows; + ds->recvShadows = recvShadows; + /* set shader */ ds->shaderInfo = si;