For some reason saber trails randomly disappeared. However, this does not happen on debug builds, release with debug information builds, or on Mint, just Windows release builds when either /O2 or /Ox speed optimizations are enabled in the MP Client project.
Basically what's happening is, in cg_players.cpp
You have this check that sets the actual saberTrail drawing:
if ( cg.time > saberTrail->lastTime + 2 || cg_saberTrail.integer == 2 ) // 2ms
which is getting skipped because saberTrail->lastTime is set to some high integer value (eg: 118677726 - its never the same number, just on the high end, probably just some random garbage value from not being initialized.)
Anyway to fix it, I just added an explicit set when switching weapons (in CG_CheckPlayerG2Weapons() of cg_weapons.cpp:
cgs.clientinfo[ps->clientNum].saber[0].blade[0].trail.lastTime = cg.time; //prevent undefined behavior: explicitly set sabertrail timer
That seems to have worked, but am not sure if the issue is really fixed or there's an underlying problem that got missed. Trying to do more testing to make sure I didn't miss anything before I push. Need to try it on an AMD CPU on linux as well, maybe its just a really weird AMD bug.

For some reason saber trails randomly disappeared. However, this does not happen on debug builds, release with debug information builds, or on Mint, just Windows release builds when either /O2 or /Ox speed optimizations are enabled in the MP Client project.
Basically what's happening is, in cg_players.cpp
You have this check that sets the actual saberTrail drawing:
if ( cg.time > saberTrail->lastTime + 2 || cg_saberTrail.integer == 2 ) // 2mswhich is getting skipped because saberTrail->lastTime is set to some high integer value (eg:
118677726- its never the same number, just on the high end, probably just some random garbage value from not being initialized.)Anyway to fix it, I just added an explicit set when switching weapons (in CG_CheckPlayerG2Weapons() of cg_weapons.cpp:
cgs.clientinfo[ps->clientNum].saber[0].blade[0].trail.lastTime = cg.time; //prevent undefined behavior: explicitly set sabertrail timerThat seems to have worked, but am not sure if the issue is really fixed or there's an underlying problem that got missed. Trying to do more testing to make sure I didn't miss anything before I push. Need to try it on an AMD CPU on linux as well, maybe its just a really weird AMD bug.