Closed chinese-soup closed 3 years ago
The engine checks whether cl_righthand
is enabled using value > 0.0
while the client uses value != 0.0
. This somehow inverts back surface culling.
void R_GLStudioDrawPoints() {
...
if ( cl_righthand && cl_righthand->value > 0.0 && ei.viewent.index == currententity->index )
{
qglDisable(0xB44u); // 0xB44u == GL_CULL_FACE
iFlippedVModelb = 1;
}
I think a better fix would be to replace all != 0
conditions with > 0
like in the engine.
Edit: Added meaning of 0xB44u to the code
Oh yea, I found that code as well, but I didn't read the if statement correctly in Ghidra before so it didn't occur to me at all. :smile:
I think a better fix would be to replace all
!= 0
conditions with> 0
like in the engine.
So yea, good point, did this instead, many thanks!
Thanks
Resolves #128
Looks like an engine bug (couldn't really find where it happens in Ghidra, but it's pretty obvious seeing as we don't use cl_righthand's actual value anywhere in the client code), so not much we can do here other than clamp it.
Not just using min max (without if statement) since this way it will only be called once.Resetting the cvar using Cvar_SetValue instead of min maxing the value, because engine is at fault and uses the cvar's value.EDIT: alright yea looks like this is it