mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Fix out-of-bounds hitlag sounds
This commit is contained in:
parent
fb07077c1c
commit
71ccf7c968
1 changed files with 6 additions and 1 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
#include "p_local.h"
|
#include "p_local.h"
|
||||||
#include "r_main.h"
|
#include "r_main.h"
|
||||||
#include "s_sound.h"
|
#include "s_sound.h"
|
||||||
|
#include "m_easing.h"
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void K_AddHitLag(mobj_t *mo, INT32 tics, boolean fromDamage)
|
void K_AddHitLag(mobj_t *mo, INT32 tics, boolean fromDamage)
|
||||||
|
|
@ -152,7 +153,11 @@ static void K_PlayHitLagSFX(mobj_t *victim, UINT8 tics)
|
||||||
soundID = sfx_dmgb1;
|
soundID = sfx_dmgb1;
|
||||||
}
|
}
|
||||||
|
|
||||||
soundID += ((tics * (NUM_HITLAG_SOUNDS - 1)) + (MAXHITLAGTICS >> 1)) / MAXHITLAGTICS;
|
soundID += Easing_Linear(
|
||||||
|
min(FRACUNIT, FRACUNIT*tics/MAXHITLAGTICS),
|
||||||
|
0,
|
||||||
|
NUM_HITLAG_SOUNDS-1
|
||||||
|
);
|
||||||
S_StartSound(victim, soundID);
|
S_StartSound(victim, soundID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue