diff --git a/src/k_kart.c b/src/k_kart.c index 066c8a4e3..a86d93ff1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6039,10 +6039,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_SetScale(overlay, player->mo->scale); } player->kartstuff[k_invincibilitytimer] = itemtime+(2*TICRATE); // 10 seconds + if (P_IsLocalPlayer(player) && cv_supermusic.value == 1 && cv_birdmusic.value) S_ChangeMusicSpecial("kinvnc"); else S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc)); + P_RestoreMusic(player); K_PlayPowerGloatSound(player->mo); player->kartstuff[k_itemamount]--; diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2828dae0f..4b21a0e8b 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1234,6 +1234,18 @@ static int lib_pCheckSight(lua_State *L) return 1; } +// DONT USE THIS FOR ANYTHING GAMEPLAY, THIS WILL DESYNCH! +static int lib_pCheckSightFast(lua_State *L) +{ + mobj_t *t1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + mobj_t *t2 = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ)); + //HUDSAFE? + if (!t1 || !t2) + return LUA_ErrInvalid(L, "mobj_t"); + lua_pushboolean(L, P_CheckSightFast(t1, t2)); + return 1; +} + static int lib_pCheckHoopPosition(lua_State *L) { mobj_t *hoopthing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -3288,6 +3300,7 @@ static luaL_Reg lib[] = { {"P_SlideMove",lib_pSlideMove}, {"P_BounceMove",lib_pBounceMove}, {"P_CheckSight", lib_pCheckSight}, + {"P_CheckSightFast", lib_pCheckSightFast}, {"P_CheckHoopPosition",lib_pCheckHoopPosition}, {"P_RadiusAttack",lib_pRadiusAttack}, {"P_FloorzAtPos",lib_pFloorzAtPos}, diff --git a/src/p_sight.c b/src/p_sight.c index 0cebc61a1..862b98e03 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -305,8 +305,8 @@ static boolean P_CrossBSPNode(INT32 bspnum, register los_t *los, boolean fast) { register node_t *bsp = nodes + bspnum; - INT32 side = fast ? R_PointOnSideFast(los->strace.x, los->strace.y, bsp) : (P_DivlineSide(los->strace.x,los->strace.y,(divline_t *)bsp) & 1); - INT32 side2 = fast ? R_PointOnSideFast(los->t2x, los->t2y, bsp) : P_DivlineSide(los->t2x, los->t2y, (divline_t *) bsp); + INT32 side = (fast ? R_PointOnSideFast(los->strace.x, los->strace.y, bsp) : (P_DivlineSide(los->strace.x,los->strace.y, (divline_t *)bsp) & 1)); + INT32 side2 = (fast ? R_PointOnSideFast(los->t2x, los->t2y, bsp) : P_DivlineSide(los->t2x, los->t2y, (divline_t *) bsp)); if (side == side2) { @@ -322,7 +322,7 @@ static boolean P_CrossBSPNode(INT32 bspnum, register los_t *los, boolean fast) } else { - bspnum = bsp->children[side ^ 1]; // cross the ending side + bspnum = bsp->children[side^1]; // cross the ending side } } } diff --git a/src/p_tick.c b/src/p_tick.c index 266defd74..3b0cadde8 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -720,12 +720,12 @@ void P_Ticker(boolean run) continue; const boolean skybox = (skyboxmo[0] && cv_skybox.value); - boolean isSkyVisibleForPlayer = skyVisiblePerPlayer[i]; - if (isSkyVisibleForPlayer && skybox) + if (skyVisiblePerPlayer[i] && skybox) { R_SkyboxFrame(i); } + R_SetupFrame(i, skybox); } } diff --git a/src/s_sound.c b/src/s_sound.c index 122b07525..119b0cbb9 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1854,10 +1854,7 @@ void S_StopMusic(void) || demo.title) // SRB2Kart: Demos don't interrupt title screen music return; - if (cv_birdmusic.value && (strcasecmp(music_name, mapmusname) == 0)) - mapmusresume = I_GetSongPosition(); - else - mapmusresume = 0; + mapmusresume = (cv_birdmusic.value && (strcasecmp(music_name, mapmusname) == 0)) ? I_GetSongPosition() : 0; if (I_SongPaused()) I_ResumeSong(); diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 20cd3107c..ced911eba 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -615,6 +615,7 @@ Countstutter (int len) } else bytes = ( music_bytes - music_stutter_bytes ); + I_SetSongPosition((int)( bytes/4/44100.0*1000 )); } }