mirror of https://bitbucket.org/CPMADevs/cnq3
fixed RB_RenderLitSurfList still crashing because of an invalid stage index
the first attempt was f99c223495
this is really not a proper fix since I haven't solved how it gets to that stage
but, knowing I will be deleting this whole part of the code soon enough anyway...
This commit is contained in:
parent
928c9a71ec
commit
9895f3b895
|
@ -419,13 +419,15 @@ static void RB_RenderLitSurfList( dlight_t* dl, qbool opaque )
|
||||||
if (!opaque && shader->sort <= SS_OPAQUE)
|
if (!opaque && shader->sort <= SS_OPAQUE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const int stageIndex = shader->lightingStages[ST_DIFFUSE];
|
||||||
|
if (stageIndex < 0 || stageIndex >= shader->numStages)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (shaderPrev)
|
if (shaderPrev)
|
||||||
RB_EndSurface();
|
RB_EndSurface();
|
||||||
RB_BeginSurface( shader, fogNum );
|
RB_BeginSurface( shader, fogNum );
|
||||||
tess.greyscale = litSurf->greyscale;
|
tess.greyscale = litSurf->greyscale;
|
||||||
|
|
||||||
// stage index is guaranteed valid by R_AddLitSurface
|
|
||||||
const int stageIndex = shader->lightingStages[ST_DIFFUSE];
|
|
||||||
const shaderStage_t* const stage = shader->stages[stageIndex];
|
const shaderStage_t* const stage = shader->stages[stageIndex];
|
||||||
backEnd.dlIntensity = (shader->contentFlags & liquidFlags) != 0 ? 0.5f : 1.0f;
|
backEnd.dlIntensity = (shader->contentFlags & liquidFlags) != 0 ? 0.5f : 1.0f;
|
||||||
backEnd.dlStateBits =
|
backEnd.dlStateBits =
|
||||||
|
|
Loading…
Reference in New Issue