From 9e4937d07f339d3c5727aa1d5ecd90c8186da012 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 15:06:07 -0400 Subject: [PATCH 01/10] Don't f12 time over'd players --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 617712f7..f6115617 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1840,6 +1840,9 @@ boolean G_Responder(event_t *ev) if (players[displayplayer].exiting) continue; + if (players[displayplayer].pflags & PF_TIMEOVER) + continue; + // I don't know if we want this actually, but I'll humor the suggestion anyway if (G_BattleGametype()) { From 9cd47643dfac9cc33c86c7dcb8df1637109f111b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 15:08:04 -0400 Subject: [PATCH 02/10] Falling rocks only collide with players and other rocks --- src/p_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 468a5c67..9c343944 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1077,7 +1077,8 @@ static boolean PIT_CheckThing(mobj_t *thing) //} - if (thing->type == MT_FALLINGROCK || tmthing->type == MT_FALLINGROCK) + if ((thing->type == MT_FALLINGROCK && (tmthing->player || tmthing->type == MT_FALLINGROCK)) + || (tmthing->type == MT_FALLINGROCK && (thing->player || thing->type == MT_FALLINGROCK))) { // see if it went over / under if (tmthing->z > thing->z + thing->height) From 89887ccf0d2f536a796dd0367e978a3507f32dda Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 16:08:46 -0400 Subject: [PATCH 03/10] Modify distx/disty to ensure it never goes too low --- src/k_kart.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f13f1742..04534568 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1052,7 +1052,6 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) mobj_t *fx; fixed_t momdifx, momdify; fixed_t distx, disty; - //fixed_t nobumpx = 0, nobumpy = 0; fixed_t dot, p; fixed_t mass1, mass2; @@ -1101,20 +1100,28 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) momdify = FixedMul((25*mapheaderinfo[gamemap-1]->mobj_scale), normalisedy); } - /*if (mass1 == 0 && mass2 > 0) - { - nobumpx = mobj2->momx; - nobumpy = mobj2->momy; - } - else if (mass2 == 0 && mass1 > 0) - { - nobumpx = mobj1->momx; - nobumpy = mobj1->momy; - }*/ - + // Adds the OTHER player's momentum, so that it reduces the chance of you being "inside" the other object distx = (mobj1->x + mobj2->momx) - (mobj2->x + mobj1->momx); disty = (mobj1->y + mobj2->momy) - (mobj2->y + mobj1->momy); + { // Don't allow dist to get WAY too low, that it pushes you stupidly huge amounts, or backwards... + fixed_t dist = P_AproxDistance(distx, disty); + fixed_t nx = FixedDiv(distx, dist); + fixed_t ny = FixedDiv(disty, dist); + + if (P_AproxDistance(distx, disty) < 3*mobj1->radius/4) + { + distx = FixedMul(mobj1->radius/2, nx); + disty = FixedMul(mobj1->radius/2, ny); + } + + if (P_AproxDistance(distx, disty) < 3*mobj2->radius/4) + { + distx = FixedMul(mobj2->radius/2, nx); + disty = FixedMul(mobj2->radius/2, ny); + } + } + if (distx == 0 && disty == 0) { // if there's no distance between the 2, they're directly on top of each other, don't run this From ebb0733a3cc2bb0a3c75da37668d32c1091a818b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 16:16:57 -0400 Subject: [PATCH 04/10] Fix camera not noclipping FOFs --- src/p_user.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index a6566cce..8dad7a6e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8162,10 +8162,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall fixed_t x, y, z, dist, height, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight; fixed_t pan, xpan, ypan; INT32 camrotate; - boolean camstill, cameranoclip, lookback; + boolean camstill, lookback; mobj_t *mo; - subsector_t *newsubsec; fixed_t f1, f2; +#ifndef NOCLIPCAM + boolean cameranoclip; + subsector_t *newsubsec; +#endif // We probably shouldn't move the camera if there is no player or player mobj somehow if (!player || !player->mo) @@ -8173,9 +8176,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall mo = player->mo; -#ifdef NOCLIPCAM - cameranoclip = true; // We like camera noclip! -#else +#ifndef NOCLIPCAM cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!! || (leveltime < introtime)); // Kart intro cam @@ -8411,6 +8412,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall else z = mo->z + pviewheight + camheight; +#ifndef NOCLIPCAM // Disable all z-clipping for noclip cam // move camera down to move under lower ceilings newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1)); @@ -8608,6 +8610,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (thiscam->z < thiscam->floorz && !cameranoclip) thiscam->z = thiscam->floorz; +#endif // NOCLIPCAM // point viewed by the camera // this point is just 64 unit forward the player From 3ec228d34f560ab8b295b4979734dce81f5f9231 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 16:22:41 -0400 Subject: [PATCH 05/10] No more cheesing Shrink by dying (If that was kept, we'd see it exploited all the time on release :V) --- src/g_game.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index f6115617..f4a62b09 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2359,6 +2359,7 @@ void G_PlayerReborn(INT32 player) INT32 itemamount; INT32 itemroulette; INT32 roulettetype; + INT32 growshrinktimer; INT32 bumper; INT32 comebackpoints; INT32 wanted; @@ -2422,6 +2423,7 @@ void G_PlayerReborn(INT32 player) roulettetype = 0; itemtype = 0; itemamount = 0; + growshrinktimer = 0; bumper = (G_BattleGametype() ? cv_kartbumpers.value : 0); comebackpoints = 0; wanted = 0; @@ -2445,6 +2447,9 @@ void G_PlayerReborn(INT32 player) itemamount = players[player].kartstuff[k_itemamount]; } + // Keep Shrink status, remove Grow status + growshrinktimer = min(players[player].kartstuff[k_growshrinktimer], 0); + bumper = players[player].kartstuff[k_bumper]; comebackpoints = players[player].kartstuff[k_comebackpoints]; wanted = players[player].kartstuff[k_wanted]; @@ -2509,6 +2514,7 @@ void G_PlayerReborn(INT32 player) p->kartstuff[k_roulettetype] = roulettetype; p->kartstuff[k_itemtype] = itemtype; p->kartstuff[k_itemamount] = itemamount; + p->kartstuff[k_growshrinktimer] = growshrinktimer; p->kartstuff[k_bumper] = bumper; p->kartstuff[k_comebackpoints] = comebackpoints; p->kartstuff[k_comebacktimer] = comebacktime; From a1da768a87f9dd1e9e5629e224e79277dc6cd803 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 16:26:24 -0400 Subject: [PATCH 06/10] Keep specator join request on respawn --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index f4a62b09..27767021 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2372,7 +2372,7 @@ void G_PlayerReborn(INT32 player) exiting = players[player].exiting; jointime = players[player].jointime; spectator = players[player].spectator; - pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE)); + pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE|PF_WANTSTOJOIN)); // As long as we're not in multiplayer, carry over cheatcodes from map to map if (!(netgame || multiplayer)) From 40b9644e0c97a37d0ada389e81240d04e20273ca Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 16:32:06 -0400 Subject: [PATCH 07/10] Use COM_ImmedExecute("restartaudio") instead of duplicated code --- src/d_netcmd.c | 6 +++++- src/m_menu.c | 17 +---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 120ffc55..0b885ab3 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4855,9 +4855,13 @@ static void Command_RestartAudio_f(void) I_SetSfxVolume(cv_soundvolume.value); I_SetDigMusicVolume(cv_digmusicvolume.value); //I_SetMIDIMusicVolume(cv_midimusicvolume.value); + + S_StartSound(NULL, sfx_strpst); + if (Playing()) // Gotta make sure the player is in a level P_RestoreMusic(&players[consoleplayer]); - + else + S_ChangeMusicInternal("titles", looptitle); } /** Quits a game and returns to the title screen. diff --git a/src/m_menu.c b/src/m_menu.c index 2e2a79e0..8adcc954 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -9043,22 +9043,7 @@ static void M_ToggleDigital(INT32 choice) static void M_RestartAudio(void) { - S_StopMusic(); - I_ShutdownMusic(); - I_ShutdownSound(); - I_StartupSound(); - I_InitMusic(); - - I_SetSfxVolume(cv_soundvolume.value); - I_SetDigMusicVolume(cv_digmusicvolume.value); - //I_SetMIDIMusicVolume(cv_midimusicvolume.value); - - S_StartSound(NULL, sfx_strpst); - - if (Playing()) // Gotta make sure the player is in a level - P_RestoreMusic(&players[consoleplayer]); - else - S_ChangeMusicInternal("titles", looptitle); + COM_ImmedExecute("restartaudio"); } // =============== From 685ccf53ccbe7177be30de7c15606b67dd89b47c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 17:03:02 -0400 Subject: [PATCH 08/10] Remove restart audio system from the menu Learned the cause of the seemingly random crashes it causes; doesn't seem easy to fix, so it can stay a relatively-unknown console command until it does --- src/m_menu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 8adcc954..7f71a7c7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1315,7 +1315,7 @@ static menuitem_t OP_SoundOptionsMenu[] = { {IT_KEYHANDLER|IT_STRING, NULL, "SFX", M_ToggleSFX, 10}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, - NULL, "SFX Volume", &cv_soundvolume, 18}, + NULL, "SFX Volume", &cv_soundvolume, 18}, {IT_KEYHANDLER|IT_STRING, NULL, "Music", M_ToggleDigital, 30}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, @@ -1330,16 +1330,16 @@ static menuitem_t OP_SoundOptionsMenu[] = NULL, "CD Volume", &cd_volume, 40}, #endif*/ - {IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50}, + //{IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50}, - {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 65}, - {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 75}, + {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 50}, + {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 60}, - {IT_STRING|IT_CVAR, NULL, "Chat sounds", &cv_chatnotifications, 90}, - {IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 100}, - {IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 110}, + {IT_STRING|IT_CVAR, NULL, "Chat sounds", &cv_chatnotifications, 75}, + {IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 85}, + {IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 95}, - {IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 125}, + {IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, }; /*static menuitem_t OP_DataOptionsMenu[] = From 3dc02a4eb480ed95a4327a9a296167be22bfe820 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 17:24:58 -0400 Subject: [PATCH 09/10] Minor mistakes on my part --- src/k_kart.c | 12 ++++++------ src/m_menu.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 04534568..ecba2026 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1109,16 +1109,16 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) fixed_t nx = FixedDiv(distx, dist); fixed_t ny = FixedDiv(disty, dist); - if (P_AproxDistance(distx, disty) < 3*mobj1->radius/4) + if (P_AproxDistance(distx, disty) < (3*mobj1->radius)/4) { - distx = FixedMul(mobj1->radius/2, nx); - disty = FixedMul(mobj1->radius/2, ny); + distx = FixedMul((3*mobj1->radius)/4, nx); + disty = FixedMul((3*mobj1->radius)/4, ny); } - if (P_AproxDistance(distx, disty) < 3*mobj2->radius/4) + if (P_AproxDistance(distx, disty) < (3*mobj2->radius)/4) { - distx = FixedMul(mobj2->radius/2, nx); - disty = FixedMul(mobj2->radius/2, ny); + distx = FixedMul((3*mobj2->radius)/4, nx); + disty = FixedMul((3*mobj2->radius)/4, ny); } } diff --git a/src/m_menu.c b/src/m_menu.c index 7f71a7c7..144ed58c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -314,7 +314,7 @@ menu_t OP_SoundOptionsDef; static void M_ToggleSFX(INT32 choice); static void M_ToggleDigital(INT32 choice); //static void M_ToggleMIDI(INT32 choice); -static void M_RestartAudio(void); +//static void M_RestartAudio(void); //Misc menu_t /*OP_DataOptionsDef,*/ OP_ScreenshotOptionsDef, OP_EraseDataDef; @@ -9041,10 +9041,10 @@ static void M_ToggleDigital(INT32 choice) } }*/ -static void M_RestartAudio(void) +/*static void M_RestartAudio(void) { COM_ImmedExecute("restartaudio"); -} +}*/ // =============== // VIDEO MODE MENU From 7aa8b94b22089e0889322f8466b9b526b3d81cff Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 22 Oct 2018 17:48:21 -0400 Subject: [PATCH 10/10] Cam follows faster in 2P --- src/p_user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 8dad7a6e..ccbf6c66 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8637,7 +8637,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall { thiscam->momx = x - thiscam->x; thiscam->momy = y - thiscam->y; - thiscam->momz = FixedMul(z - thiscam->z, camspeed/2); + if (splitscreen == 1) // Wide-screen needs to follow faster, due to a smaller vertical:horizontal ratio of screen space + thiscam->momz = FixedMul(z - thiscam->z, (3*camspeed)/4); + else + thiscam->momz = FixedMul(z - thiscam->z, camspeed/2); } thiscam->pan = pan;