OpenGL2: Fix parsing q3gl2_sun without two additional tokens

If mapLightScale and shadowScale weren't included at the end of
q3gl2_sun, the next shader line was skipped by SkipRestOfLine().

COM_ParseExt() with allowLineBreaks=qfalse, returns "" once and
then goes to the next line anyway. (Doesn't work well multiple
"optional" tokens. It looks like a vanilla bug.)
This commit is contained in:
Zack Middleton 2023-12-22 22:00:57 -06:00
parent ae0878ca61
commit b07ff2a3ca

View file

@ -1841,12 +1841,17 @@ static qboolean ParseShader( char **text )
tr.sunShadowScale = atof(token); tr.sunShadowScale = atof(token);
// parse twice, since older shaders may include mapLightScale before sunShadowScale // parse twice, since older shaders may include mapLightScale before sunShadowScale
token = COM_ParseExt( text, qfalse ); if (token[0]) {
if (token[0]) token = COM_ParseExt( text, qfalse );
tr.sunShadowScale = atof(token); if (token[0]) {
tr.sunShadowScale = atof(token);
}
}
} }
SkipRestOfLine( text ); if (token[0]) {
SkipRestOfLine( text );
}
continue; continue;
} }
// tonemap parms // tonemap parms