Merge branch 'fix-hitlag-level-music' into 'master'

Fix level music not starting during hitlag

Closes #178

See merge request KartKrew/Kart!455
This commit is contained in:
James R 2021-11-28 00:20:20 +00:00
commit 9abb632d19
2 changed files with 7 additions and 7 deletions

View file

@ -6983,13 +6983,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
// Handle invincibility sfx
K_UpdateInvincibilitySounds(player); // Also thanks, VAda!
// Plays the music after the starting countdown.
if (P_IsLocalPlayer(player) && leveltime == (starttime + (TICRATE/2)))
{
S_ChangeMusic(mapmusname, mapmusflags, true);
S_ShowMusicCredit();
}
}
void K_KartPlayerAfterThink(player_t *player)

View file

@ -608,6 +608,13 @@ void P_Ticker(boolean run)
if (playeringame[i] && players[i].mo && !P_MobjWasRemoved(players[i].mo))
P_PlayerAfterThink(&players[i]);
// Plays the music after the starting countdown.
if (leveltime == (starttime + (TICRATE/2)))
{
S_ChangeMusic(mapmusname, mapmusflags, true);
S_ShowMusicCredit();
}
ps_lua_thinkframe_time = I_GetPreciseTime();
LUAh_ThinkFrame();
ps_lua_thinkframe_time = I_GetPreciseTime() - ps_lua_thinkframe_time;