- Blood: Apply a slightly better fix for the akimbo shotgun animation kQAV2SHOTF2 (res_id: 61).

* The issue here is that `pPlayer->weaponTimer` reaches 0 before the animation plays out. This is because the QAV timer has its own ticrate independent of the game's timer.
* A workaround like this is still the best approach for now as its not easily possible to remove `weaponTimer` within the game without messing up the trigger system that runs at ticrate.
This commit is contained in:
Mitchell Richters 2021-08-27 22:18:57 +10:00
parent f3e10a595d
commit 656ec8ef06
3 changed files with 4 additions and 4 deletions

View file

@ -286,7 +286,7 @@ void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
*duration = ClipLow(*duration, 0);
}
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration)
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration, bool const ignoreWeaponTimer)
{
// Process if not paused.
if (!paused)
@ -294,7 +294,7 @@ void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, doub
// Process clock based on QAV's ticrate and last tick value.
qavProcessTicker(pQAV, &pPlayer->qavTimer, &pPlayer->qavLastTick);
if (pPlayer->weaponTimer == 0)
if (pPlayer->weaponTimer == 0 && !ignoreWeaponTimer)
{
// Check if we're playing an idle QAV as per the ticker's weapon timer.
*duration = fixedduration ? pQAV->duration - 1 : I_GetBuildTime() % pQAV->duration;

View file

@ -240,7 +240,7 @@ struct QAV
QAV* getQAV(int res_id);
void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick);
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration = false);
void qavProcessTimer(PLAYER* const pPlayer, QAV* const pQAV, int* duration, double* smoothratio, bool const fixedduration = false, bool const ignoreWeaponTimer = false);
inline bool qavIsOriginal(const int& res_id)
{

View file

@ -256,7 +256,7 @@ void WeaponDraw(PLAYER *pPlayer, int shade, double xpos, double ypos, int palnum
int duration;
double smoothratio;
qavProcessTimer(pPlayer, pQAV, &duration, &smoothratio, pPlayer->weaponState == -1 || (pPlayer->curWeapon == kWeapShotgun && pPlayer->weaponState == 7));
qavProcessTimer(pPlayer, pQAV, &duration, &smoothratio, pPlayer->weaponState == -1, pPlayer->curWeapon == kWeapShotgun && pPlayer->weaponState == 7);
pQAV->x = int(xpos);
pQAV->y = int(ypos);