"alphagen wave sin" stage) to dead bodies so that the bodies disappear (fade out) instead of sinking into the floor (or, as is the case with my mod where they suddenly disappear, which is even worse).
I've added this bit of code to player_die() in g_combat.c:
Code: Select all
self->s.time = level.time;
Code: Select all
if ( cent->currentState.eFlags & EF_DEAD ) {
legs.customShader = cgs.media.deadBotShader;
legs.shaderTime = cent->currentState.time;
}
I assumed that legs.shaderTime would properly set the starting point of the shader animation (the fade out) but it doesn't. It appears that this isn't the case, as the starting point of my alphagen sine differs every time I shoot an enemy (sometimes even inverted to how I want it, causing the body to suddenly disappear and fade into view). I've checked and cent->currentState.time does match the server-side level.time.
Does anyone know if I'm doing something wrong or if the shaderTime is bugged or something? I would love to be able to reliably set the starting point in the wave of my shader.