Jetpack event timer added - JP sound and effects independent from FPS

This commit is contained in:
pierow 2018-08-12 22:30:08 -04:00
parent 6fe8d49d19
commit dca187fa4c

View file

@ -160,6 +160,7 @@ extern int gBlinkEffectSuccessEventID;
#include "../mod/AvHSelectionHelper.h"
int gHeightLevel = 0;
int JpEventTimer = 0;
const float kMarineBackpedalSpeedScalar = .4f;
const float kMarineSidestepSpeedScalar = 1.0f;
@ -6380,11 +6381,17 @@ void PM_Jetpack()
pmove->velocity[1] += (theWishVelocity[1] / pmove->clientmaxspeed) * (theTimePassed * theWeightScalar*kJetpackForce);
pmove->velocity[2] += theTimePassed*theWeightScalar*kJetpackForce;
// Play an event every so often
if(pmove->runfuncs /*&& (pmove->RandomLong(0, 2) == 0)*/)
{
pmove->PM_PlaybackEventFull(0, pmove->player_index, gJetpackEventID, 0, (float *)pmove->origin, (float *)pmove->origin, 0.0, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 );
}
//FPS independent jetpack event. Scales with FPS without timer.
JpEventTimer += pmove->cmd.msec;
if (JpEventTimer > 7)
{
// Play an event every so often
if (pmove->runfuncs /*&& (pmove->RandomLong(0, 2) == 0)*/)
{
pmove->PM_PlaybackEventFull(0, pmove->player_index, gJetpackEventID, 0, (float *)pmove->origin, (float *)pmove->origin, 0.0, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0);
}
JpEventTimer = 0;
}
}
float theJetpackEnergy = pmove->fuser3/kNormalizationNetworkFactor;