From 5fb5af05be6bd692a49c28d45cdb8fe9c6cfa7cc Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 27 Jun 2026 23:39:23 +0200 Subject: [PATCH 01/30] this is P_NetUnArchiveThinkers lululul --- src/p_saveg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 37fcf4c3e..2264a2be5 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3059,7 +3059,7 @@ static void P_NetUnArchiveThinkers(savebuffer_t *save) break; default: - I_Error("P_UnarchiveSpecials: Unknown tclass %d in savegame", tclass); + I_Error("P_NetUnArchiveThinkers: Unknown tclass %d in savegame", tclass); } } From 71640202edd44290b697810c6224c4968608cf86 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 27 Jun 2026 23:42:01 +0200 Subject: [PATCH 02/30] better polyobj count error for savegame from Banpyura gonna look into their return to menu instead of i_error stuff sometime --- src/p_saveg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 2264a2be5..1b7f21c47 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3170,7 +3170,7 @@ FUNCINLINE static ATTRINLINE void P_UnArchivePolyObjects(savebuffer_t *save) numSavedPolys = READINT32(save->p); if (numSavedPolys != numPolyObjects) - I_Error("P_UnArchivePolyObjects: polyobj count inconsistency\n"); + I_Error("P_UnArchivePolyObjects: polyobj count inconsistency (expected %d, got %d)\n", numPolyObjects, numSavedPolys); for (i = 0; i < numSavedPolys; ++i) P_UnArchivePolyObj(save, &PolyObjects[i]); From ba75523d485d2c58b7116547643181c764f6c34f Mon Sep 17 00:00:00 2001 From: romoney5 Date: Mon, 8 Jun 2026 17:45:28 -0400 Subject: [PATCH 03/30] Print a warning when archiving an invalid Lua value --- src/lua_script.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lua_script.c b/src/lua_script.c index 2649a57c7..4e1cfc995 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -713,9 +713,12 @@ static UINT8 GetUserdataArchType(int index) static UINT8 ArchiveValue(UINT8 **p, int TABLESINDEX, int myindex) { + int type = lua_type(gL, myindex); + if (myindex < 0) myindex = lua_gettop(gL)+1+myindex; - switch (lua_type(gL, myindex)) + + switch (type) { case LUA_TNONE: case LUA_TNIL: @@ -725,8 +728,12 @@ static UINT8 ArchiveValue(UINT8 **p, int TABLESINDEX, int myindex) case LUA_TLIGHTUSERDATA: case LUA_TTHREAD: case LUA_TFUNCTION: + { + const char *typestr = (type == LUA_TLIGHTUSERDATA ? "light userdata" : (type == LUA_TTHREAD ? "thread" : (type == LUA_TFUNCTION ? "function" : "??"))); + CONS_Alert(CONS_ERROR, M_GetText("Archived an invalid value! (%s)\n"), typestr); WRITEUINT8(*p, ARCH_NULL); return 2; + } case LUA_TBOOLEAN: WRITEUINT8(*p, ARCH_BOOLEAN); WRITEUINT8(*p, lua_toboolean(gL, myindex)); From 3606b0ae6641ade941de992fe946f6413874d9f7 Mon Sep 17 00:00:00 2001 From: romoney5 Date: Fri, 24 Apr 2026 19:34:46 -0400 Subject: [PATCH 04/30] Don't disable console on resync --- src/d_clisrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7fb65d4d3..492dd0ac4 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2181,7 +2181,8 @@ static void CL_LoadReceivedSavegame(boolean reloading) if (unlink(tmpsave) == -1) CONS_Alert(CONS_ERROR, M_GetText("Can't delete %s\n"), tmpsave); consistancy[gametic%BACKUPTICS] = Consistancy(); - CON_ToggleOff(); + if (!reloading) + CON_ToggleOff(); #ifdef SATURNPAK // Tell the server we have received and reloaded the gamestate From 2ba4757c6acde230b5731c4b4ac74ae746a208ac Mon Sep 17 00:00:00 2001 From: GLide KS <84994993+GLideKS@users.noreply.github.com> Date: Thu, 11 Jun 2026 21:09:59 -0400 Subject: [PATCH 05/30] Hopefully a cleaner implementation of Local Addon switch --- src/m_menu.c | 64 +++++++++++++++++++++++++++++++----------------- src/m_menudefs.c | 4 +-- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index e80fbf47e..ac571d6f1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -151,8 +151,6 @@ const char *quitmsg[NUM_QUITMESSAGES] = {}; INT32 mapwads[NUMMAPS] = {}; -boolean browselocalskins = false; - boolean menuactive = false; boolean fromlevelselect = false; @@ -221,6 +219,11 @@ static boolean setupm_skinlockedselect; static UINT8 setupm_playernum; //brap +// Addons Menu: Local mode +static void M_LocalAddons(INT32 choice); +#define LOCALMODE_KEY (KEY_RALT) +static boolean addons_localmode = false; + // // PROTOTYPES // @@ -325,7 +328,6 @@ static void M_EraseData(INT32 choice); static void M_AddonsInternal(); static void M_Addons(INT32 choice); -static void M_LocalSkins(INT32 choice); static void M_AddonsOptions(INT32 choice); #define addonmenusize 9 // number of items actually displayed in the addons menu view, formerly (2*numaddonsshown + 1) #define numaddonsshown 4 // number of items to each side of the currently selected item, unless at top/bottom ends of directory @@ -1014,6 +1016,24 @@ boolean M_Responder(event_t *ev) case KEY_HAT1 + 3: ch = KEY_RIGHTARROW; break; + //Local Addon Mode + case LOCALMODE_KEY: + { + if (!(server || IsPlayerAdmin(consoleplayer))) + break; + + if (!addons_localmode) + { + S_StartSound(NULL, sfx_ding); + addons_localmode = true; + } + else + { + S_StartSound(NULL, sfx_jshard); + addons_localmode = false; + } + } + break; } } else if (menuactive) @@ -1718,19 +1738,16 @@ void M_StartControlPanel(void) MPauseMenu[mpause_switchteam].status = IT_DISABLED; MPauseMenu[mpause_switchspectate].status = IT_DISABLED; MPauseMenu[mpause_psetup].status = IT_DISABLED; + MPauseMenu[mpause_localaddons].status = IT_STRING | IT_CALL; + MISC_ChangeTeamMenu[0].status = IT_DISABLED; MISC_ChangeSpectateMenu[0].status = IT_DISABLED; - MPauseMenu[mpause_addlocalskins].status = IT_STRING | IT_CALL; MPauseMenu[mpause_localskin].status = IT_STRING | IT_CALL; // Reset these in case splitscreen messes things up MPauseMenu[mpause_addons].alphaKey = 8; - - if (IsPlayerAdmin(consoleplayer)) - MPauseMenu[mpause_addlocalskins].alphaKey = 16; - else - MPauseMenu[mpause_addlocalskins].alphaKey = 24; + MPauseMenu[mpause_localaddons].alphaKey = 24; MPauseMenu[mpause_scramble].alphaKey = 8; MPauseMenu[mpause_switchmap].alphaKey = 24; @@ -1748,14 +1765,13 @@ void M_StartControlPanel(void) { MPauseMenu[mpause_switchmap].status = IT_STRING | IT_CALL; MPauseMenu[mpause_addons].status = IT_STRING | IT_CALL; - + MPauseMenu[mpause_localaddons].status = IT_DISABLED; if (G_GametypeHasTeams()) MPauseMenu[mpause_scramble].status = IT_STRING | IT_SUBMENU; } if (server || (!cv_showlocalskinmenus.value)) { - MPauseMenu[mpause_addlocalskins].status = IT_DISABLED; MPauseMenu[mpause_localskin].status = IT_DISABLED; MPauseMenu[mpause_options].alphaKey = 64; @@ -1763,7 +1779,6 @@ void M_StartControlPanel(void) MPauseMenu[mpause_quit].alphaKey = 88; } - if (splitscreen) { MPauseMenu[mpause_psetupsplit].status = MPauseMenu[mpause_psetupsplit2].status = IT_STRING | IT_CALL; @@ -3308,14 +3323,14 @@ static void M_AddonsInternal(void) static void M_Addons(INT32 choice) { (void)choice; - browselocalskins = false; + addons_localmode = false; M_AddonsInternal(); } -static void M_LocalSkins(INT32 choice) +static void M_LocalAddons(INT32 choice) { (void)choice; - browselocalskins = true; + addons_localmode = true; M_AddonsInternal(); } @@ -3484,8 +3499,8 @@ static void M_DrawAddons(void) if (Playing()) { - if (browselocalskins) - V_DrawCenteredString(BASEVIDWIDTH/2, 5, V_ALLOWLOWERCASE, "Load \x83local skins\x80 from addons!"); + if (addons_localmode) // Draw notice that you're adding locally + V_DrawCenteredString(BASEVIDWIDTH/2, 5, V_ALLOWLOWERCASE, "Load addons or \x83local skins\x80 locally!"); else V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems."); } @@ -3649,6 +3664,9 @@ static void M_DrawAddons(void) //V_DrawCenteredString(BASEVIDWIDTH/2, y+24, (majormods ? highlightflags : V_TRANSLUCENT), va("%d ADD-ON%s LOADED", (int)m, (m == 1) ? "" : "S")); //+2 for music, sounds, +1 for main.kart V_DrawThinString(0, BASEVIDHEIGHT-10, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_TRANSLUCENT|V_ALLOWLOWERCASE, ("END Key - Add addon to autoload")); + + if (Playing() && (server || IsPlayerAdmin(consoleplayer))) + V_DrawThinString(0, BASEVIDHEIGHT-20, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_TRANSLUCENT|V_ALLOWLOWERCASE, ("Right ALT Key - Switch to local addon mode")); } static void M_AddonExec(INT32 ch) @@ -3838,14 +3856,14 @@ static void M_HandleAddons(INT32 choice) case EXT_KART: #endif case EXT_PK3: - if (browselocalskins) + if (addons_localmode) { - if (DumbStartsWith("KC_", dirmenu[dir_on[menudepthleft]]+DIR_STRING) || DumbStartsWith("kc_", dirmenu[dir_on[menudepthleft]]+DIR_STRING)) { + if (DumbStartsWith("KC_", dirmenu[dir_on[menudepthleft]]+DIR_STRING) || DumbStartsWith("kc_", dirmenu[dir_on[menudepthleft]]+DIR_STRING)) + { M_StartMessage(va("%c%s\x80\nYou are loading a local skin.\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING); - COM_BufAddText(va("addfilelocal \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING)); } - else - S_StartSound(NULL, sfx_s26d); + + COM_BufAddText(va("addfilelocal \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING)); } else { @@ -3928,6 +3946,8 @@ static void M_HandleAddons(INT32 choice) M_SetupNextMenu(currentMenu->prevMenu); else M_ClearMenus(true); + + addons_localmode = false; //Exiting this menu, disable addons_localmode already. } } diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 0ee6af395..7966d5173 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -208,7 +208,7 @@ typedef enum static menuitem_t MPauseMenu[] = { {IT_STRING | IT_CALL, NULL, "Addons...", M_Addons, 8}, - {IT_STRING | IT_CALL, NULL, "Add local skins...", M_LocalSkins, 16}, + {IT_STRING | IT_CALL, NULL, "Local Add-ons...", M_LocalAddons, 8}, {IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 24}, {IT_STRING | IT_CALL, NULL, "Switch Map..." , M_MapChange, 32}, @@ -238,7 +238,7 @@ static menuitem_t MPauseMenu[] = typedef enum { mpause_addons = 0, - mpause_addlocalskins, + mpause_localaddons, mpause_scramble, mpause_switchmap, #ifdef HAVE_DISCORDRPC From 49d637450555d6ba3278ceba1eae0b1860393660 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 00:24:19 +0200 Subject: [PATCH 06/30] have local skin message account for "KCL" prefix for skins with lua --- src/m_menu.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index ac571d6f1..6fc11d681 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3843,7 +3843,7 @@ static void M_HandleAddons(INT32 choice) } break; case EXT_TXT: - M_StartMessage(va("%c%s\x80\nThis file may not be a console script.\nAttempt to run anyways? \n\n(Press 'Y' to confirm)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),M_AddonExec,MM_YESNO); + M_StartMessage(va("%c%s\x80\nThis file may not be a console script.\nAttempt to run anyways? \n\n(Press 'Y' to confirm)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING), M_AddonExec, MM_YESNO); break; case EXT_CFG: M_AddonExec(KEY_ENTER); @@ -3856,20 +3856,26 @@ static void M_HandleAddons(INT32 choice) case EXT_KART: #endif case EXT_PK3: + { + const char *addonname = dirmenu[dir_on[menudepthleft]]+DIR_STRING; + if (addons_localmode) { - if (DumbStartsWith("KC_", dirmenu[dir_on[menudepthleft]]+DIR_STRING) || DumbStartsWith("kc_", dirmenu[dir_on[menudepthleft]]+DIR_STRING)) + if (DumbStartsWith("KC_", addonname) || DumbStartsWith("kc_", addonname) || + DumbStartsWith("KCL_", addonname) || DumbStartsWith("kcl_", addonname)) // skins with lua { - M_StartMessage(va("%c%s\x80\nYou are loading a local skin.\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING); + M_StartMessage(va("%c%s\x80\nYou are loading a local skin.\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), addonname), NULL, MM_NOTHING); } - COM_BufAddText(va("addfilelocal \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING)); + COM_BufAddText(va("addfilelocal \"%s%s\"", menupath, addonname)); } else { - COM_BufAddText(va("addfile \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING)); + COM_BufAddText(va("addfile \"%s%s\"", menupath, addonname)); } + break; + } default: S_StartSound(NULL, sfx_s26d); } From 73c7a5a0c4bf685e5c7ff5e636d943e1831e4bce Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 00:40:46 +0200 Subject: [PATCH 07/30] add better description for skip intro music stuff --- src/m_menudefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 7966d5173..9ede49b2e 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1175,7 +1175,7 @@ static const char* OP_SoundAdvancedTooltips[] = "Should the Grow music be on or off?", "Should the Invulnerability music be on or off?", "Should music be kept when restarting the map?", - "Should the Intro fanfare be skipped\nand map music be played on map start?", + "Should the Intro fanfare be skipped\nand map music be played on map start?\nNote that this WILL skip sounds played by the map before round start aswell!", "Controls Sound effects caching.\nKeep will retain previously played sound effects in cache." // man idk how to describe this in a non awful way lmao "\nOn will preload all sound effects.\nEliminates sound-related lag and stutters but increases memory usage.", "Size of the Audio Buffer\nreducing it will result in less sound latency\nbut may cause issues such as crackling or distorted Sound.", From 24bac9c13399fc8f21dbd92c9f7b6ac9f310a87a Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 15:09:06 +0200 Subject: [PATCH 08/30] actually print a different message for localskins with lua tell ppl that this may cause issues --- src/m_menu.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6fc11d681..9e7a7b1c1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3856,30 +3856,34 @@ static void M_HandleAddons(INT32 choice) case EXT_KART: #endif case EXT_PK3: - { - const char *addonname = dirmenu[dir_on[menudepthleft]]+DIR_STRING; - - if (addons_localmode) { - if (DumbStartsWith("KC_", addonname) || DumbStartsWith("kc_", addonname) || - DumbStartsWith("KCL_", addonname) || DumbStartsWith("kcl_", addonname)) // skins with lua + const char *addonname = dirmenu[dir_on[menudepthleft]]+DIR_STRING; + + if (addons_localmode) { - M_StartMessage(va("%c%s\x80\nYou are loading a local skin.\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), addonname), NULL, MM_NOTHING); + if (DumbStartsWith("KC_", addonname) || DumbStartsWith("kc_", addonname)) + { + M_StartMessage(va("%c%s\x80\nYou are loading a local skin.\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), addonname), NULL, MM_NOTHING); + } + else if (DumbStartsWith("KCL_", addonname) || DumbStartsWith("kcl_", addonname)) // skins with lua + { + M_StartMessage(va("%c%s\x80\nYou are loading a local skin with lua.\nBeware that this may cause issues like crashes or desyncs in some cases!\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), addonname), NULL, MM_NOTHING); + } + // no need to account for KRC cases + + COM_BufAddText(va("addfilelocal \"%s%s\"", menupath, addonname)); + } + else + { + COM_BufAddText(va("addfile \"%s%s\"", menupath, addonname)); } - - COM_BufAddText(va("addfilelocal \"%s%s\"", menupath, addonname)); } - else - { - COM_BufAddText(va("addfile \"%s%s\"", menupath, addonname)); - } - break; - } default: S_StartSound(NULL, sfx_s26d); } } + if (refresh) refreshdirmenu |= REFRESHDIR_NORMAL; } @@ -7770,7 +7774,7 @@ static void M_SetupMultiHandler(INT32 choice) if (exitmenu) { if (currentMenu->prevMenu) - M_SetupNextMenu (currentMenu->prevMenu); + M_SetupNextMenu(currentMenu->prevMenu); else M_ClearMenus(true); } From 5c373b6251c98aae5b83a8883b8fdf3c1d81aba8 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 16:04:58 +0200 Subject: [PATCH 09/30] demote those to asserts never seen srb2, saturn, RR or blan or anything else have this return null there is a possibility but whatever just continuing in such cases was wrong eitherways as it wouldve just corrupted the vres thing --- src/w_wad.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 1099667e0..c8a1dbba8 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -123,6 +123,9 @@ static const char pat_end[] = {0x50, 0x4b, 0x05, 0x06, 0x00}; UINT16 numwadfiles = 0; // number of active wadfiles wadfile_t *wadfiles[MAX_WADFILES] = {}; // 0 to numwadfiles-1 are valid +// use strnlen as some lump names may not be null terminated +#define CHECKMAPMARKER(name) (memcmp(name, "MAP", 3) == 0 && strnlen(name, 8) == 5) + // W_Shutdown // Closes all of the WAD files before quitting // If not done on a Mac then open wad files @@ -2676,8 +2679,9 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum) vlumps[i].size = vsizecache[realentry]; const char *name = (fileinfo + realentry)->name; + I_Assert(name != NULL); - if (strnlen(name, 8) == 5 && memcmp(name, "MAP", 3) == 0) + if (CHECKMAPMARKER(name)) { numlumps--; // We skip map marker, so 1 of entries becomes empty continue; // This will skip i++ so we will write to same entry @@ -2686,9 +2690,7 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum) // Play it safe with the name in this case. memcpy(vlumps[i].name, name, 8); vlumps[i].name[8] = '\0'; - vlumps[i].data = (UINT8 *)( - Z_Malloc(vlumps[i].size, PU_LEVEL, NULL) // This is memory inefficient, sorry about that. - ); + vlumps[i].data = (UINT8 *)(Z_Malloc(vlumps[i].size, PU_LEVEL, NULL)); // This is memory inefficient, sorry about that. memcpy(vlumps[i].data, wadData + LONG((fileinfo + realentry)->filepos), vlumps[i].size); i++; } @@ -2698,15 +2700,19 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum) } else { - // Count number of lumps until the end of resource OR up until next "MAPXX" lump. + // Count number of lumps until the end of resource OR up until next 0-length lump OR up until next "MAPXX" lump. lumpnum_t lumppos = lumpnum + 1; for (i = LUMPNUM(lumppos); i < wadfiles[WADFILENUM(lumpnum)]->numlumps; i++, lumppos++, numlumps++) { - const char *name = W_CheckNameForNum(lumppos); - if (name == NULL) - continue; + if (W_LumpLength(lumppos) == 0) + { + break; + } - if (memcmp(name, "MAP", 3) == 0 || W_LumpLength(lumppos) == 0) + const char *name = W_CheckNameForNum(lumppos); + I_Assert(name != NULL); + + if (CHECKMAPMARKER(name)) { break; } @@ -2721,10 +2727,9 @@ virtres_t* vres_GetMap(lumpnum_t lumpnum) { // Check if it is map marker. It is not always first lump sadly, so we need to expect it anywhere const char *name = W_CheckNameForNum(lumpnum); - if (name == NULL) - continue; + I_Assert(name != NULL); - if (strlen(name) == 5 && memcmp(name, "MAP", 3) == 0) + if (CHECKMAPMARKER(name)) { --i; // Decrement so on next iteration we write on same i, so we don't leave corrupted vlumps entry numlumps--; // Just so we don't try to access the leftover vlumps entry From af6abb54589e594b0a591008647c10e884fef36d Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 16:14:42 +0200 Subject: [PATCH 10/30] better check for map data within autoloaded files before this flagged every file with lumps that contained the MAP as string somewhere, like palettes and such this is kinda messy but i really do not want to dupe this huge block of code, neither do i want to convert this to ceepeepee again to mess about with templates oh well --- src/w_wad.c | 86 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 17 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index c8a1dbba8..06af7a127 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -2395,7 +2395,7 @@ static int W_NameStartsWith(const char *name, lumpchecklist_t *checklist) } // Checks if file contains at least one lump which name starts with one of strings in checklist -static int W_CheckWADContains(FILE *fp, lumpchecklist_t *checklist) +static int W_CheckWADContainsEx(FILE *fp, lumpchecklist_t *checklist, boolean checkmap) { size_t i, j; // if we're here it's a WAD file @@ -2436,13 +2436,29 @@ static int W_CheckWADContains(FILE *fp, lumpchecklist_t *checklist) if (!strncmp(lumpinfo.name, sprnames[j], 4)) // Sprites continue; - if (W_NameStartsWith(lumpinfo.name, checklist)) + if (checkmap) + { + if (CHECKMAPMARKER(lumpinfo.name)) + return true; + } + else if (W_NameStartsWith(lumpinfo.name, checklist)) return true; } + return false; } -static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist) +static int W_CheckWADContains(FILE *fp, lumpchecklist_t *checklist) +{ + return W_CheckWADContainsEx(fp, checklist, false); +} + +static int W_CheckWADContainsMap(FILE *fp) +{ + return W_CheckWADContainsEx(fp, NULL, true); +} + +static int W_CheckPK3ContainsEx(FILE *fp, lumpchecklist_t *checklist, boolean checkmap) { zend_t zend; zlentry_t zlentry; @@ -2516,13 +2532,23 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist) memset(lumpname, '\0', 9); // Making sure they're initialized to 0. Is it necessary? strncpy(lumpname, trimname, min(8, dotpos - trimname)); - if (W_NameStartsWith(lumpname, checklist)) + if (checkmap) + { + if (CHECKMAPMARKER(lumpname)) + return true; + } + else if (W_NameStartsWith(lumpname, checklist)) { return true; } } - if (W_NameStartsWith(fullname, checklist)) + if (checkmap) + { + if (CHECKMAPMARKER(fullname)) + return true; + } + else if (W_NameStartsWith(fullname, checklist)) { return true; } @@ -2564,12 +2590,24 @@ static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist) } } -static int W_CheckFileContains(const char *filename, lumpchecklist_t *checklist) +static int W_CheckPK3Contains(FILE *fp, lumpchecklist_t *checklist) +{ + return W_CheckPK3ContainsEx(fp, checklist, false); +} + +static int W_CheckPK3ContainsMap(FILE *fp) +{ + return W_CheckPK3ContainsEx(fp, NULL, true); +} + +static int W_CheckFileContainsEx(const char *filename, lumpchecklist_t *checklist, boolean checkmap) { FILE *handle; int contains = false; - if (!checklist) + // if we just check for maps this will be NULL + // hacky but i dont care + if (!checklist && !checkmap) I_Error("No checklist for %s\n", filename); // open wad file @@ -2580,27 +2618,41 @@ static int W_CheckFileContains(const char *filename, lumpchecklist_t *checklist) if (type == RET_PK3) { - contains = W_CheckPK3Contains(handle, checklist); + if (checkmap) + contains = W_CheckPK3ContainsMap(handle); + else + contains = W_CheckPK3Contains(handle, checklist); } else if (type == RET_WAD) { - contains = W_CheckWADContains(handle, checklist); + if (checkmap) + contains = W_CheckWADContainsMap(handle); + else + contains = W_CheckWADContains(handle, checklist); } fclose(handle); return contains; } +static int W_CheckFileContains(const char *filename, lumpchecklist_t *checklist) +{ + return W_CheckFileContainsEx(filename, checklist, false); +} + +static int W_CheckFileContainsMap(const char *filename) +{ + return W_CheckFileContainsEx(filename, NULL, true); +} + +// kinda stupid but we cant just check for any lump containing "MAP" +// we have to explicitly check if its MAP and 5 characters long +// the more correct way would be checking inside wad files nested within pk3´s +// and check the presence of actual map data like SSECTORS or something +// but man i cannot be assed to rework shit for that int W_CheckAutoLoadContainsMap(const char *filename) { - // for now this checks for map marker - static lumpchecklist_t autoloadblacklist[] = - { - {"MAP", 3}, - {NULL, 0}, - }; - - return W_CheckFileContains(filename, autoloadblacklist); + return W_CheckFileContainsMap(filename); } int W_CheckPostLoadList(const char *filename) From 820ab4b2bc8738d879c1153f0cad147e82bc08e9 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 16:23:16 +0200 Subject: [PATCH 11/30] block "addfilelocal" from adding files that contains maps now we have a more accessible menu for addfile local i really dont want to risk stuff --- src/d_main.c | 2 +- src/p_setup.c | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index e821de566..85e1242ac 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1159,7 +1159,7 @@ static void D_FindAddonsToAutoload(void) // you can probably imagine how that goes in a netgame.... if (W_CheckAutoLoadContainsMap(wadsToAutoload)) { - CONS_Printf("Autoload: file %s contains map data! skipping...", wadsToAutoload); + CONS_Alert(CONS_WARNING, "Autoload: file %s contains map data, this WILL cause crashes and desynchs! skipping...\n", wadsToAutoload); continue; } diff --git a/src/p_setup.c b/src/p_setup.c index c781761fc..fe583b406 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3334,6 +3334,17 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local) sreplaces = mreplaces = digmreplaces = 0; + if (local) + { + // check if someone tries to load maps locally lol + // do this here so we can skip loading the file anyways + if (W_CheckAutoLoadContainsMap(wadfilename)) + { + CONS_Alert(CONS_WARNING, "addilelocal: locally added file %s contains map data, this WILL cause crashes and desynchs! not added.\n", wadfilename); + return UINT16_MAX; + } + } + if ((numlumps = W_InitFile(wadfilename, local, false)) == INT16_MAX) { refreshdirmenu |= REFRESHDIR_NOTLOADED; @@ -3364,12 +3375,15 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local) allvotereplaced = true; } - if (!devparm && sreplaces) - CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces)); - if (!devparm && mreplaces) - CONS_Printf(M_GetText("%s midi musics ignored\n"), sizeu1(mreplaces)); - if (!devparm && digmreplaces) - CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces)); + if (!devparm) + { + if (sreplaces) + CONS_Printf(M_GetText("%s sounds replaced\n"), sizeu1(sreplaces)); + if (mreplaces) + CONS_Printf(M_GetText("%s midi musics ignored\n"), sizeu1(mreplaces)); + if (digmreplaces) + CONS_Printf(M_GetText("%s digital musics replaced\n"), sizeu1(digmreplaces)); + } if (!mapsadded) CONS_Printf(M_GetText("No maps added\n")); From 8bb04a68a80b82a4addfde7a01929f3446fca306 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 17:52:44 +0200 Subject: [PATCH 12/30] ass well --- src/m_menudefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 9ede49b2e..eb364bbb9 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1175,7 +1175,7 @@ static const char* OP_SoundAdvancedTooltips[] = "Should the Grow music be on or off?", "Should the Invulnerability music be on or off?", "Should music be kept when restarting the map?", - "Should the Intro fanfare be skipped\nand map music be played on map start?\nNote that this WILL skip sounds played by the map before round start aswell!", + "Should the Intro fanfare be skipped\nand map music be played on map start?\nNote that this WILL skip sounds played by the map before round start as well!", "Controls Sound effects caching.\nKeep will retain previously played sound effects in cache." // man idk how to describe this in a non awful way lmao "\nOn will preload all sound effects.\nEliminates sound-related lag and stutters but increases memory usage.", "Size of the Audio Buffer\nreducing it will result in less sound latency\nbut may cause issues such as crackling or distorted Sound.", From 530bb50709b6c793a14c83c3a8c23049d31aae72 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 17:53:47 +0200 Subject: [PATCH 13/30] ig "style" is the better word here lulul --- src/m_menudefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menudefs.c b/src/m_menudefs.c index eb364bbb9..afd365946 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1441,7 +1441,7 @@ static const char* OP_ChatOptionsTooltips[] = "Spam protection for in-game chat.", "Maxiumum amount of chat messages to look back at.", "Show player ping.", - "Choose the looks of the ping display.", // this is ass idk english lmao + "Choose the style of the ping display.", "Measurement used for ping.", "Visibility of ping icon.", "Should Player IP addresses be printed when using\nthe nodes or listplayers command?", From 496477fa9a70f50f7ba0ffec521ef1604a955c6d Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 18:37:02 +0200 Subject: [PATCH 14/30] chatbgtint does actually not apply to the chatbox but only to the also confusingly named "mini chat" --- src/m_menudefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menudefs.c b/src/m_menudefs.c index afd365946..c06df7a26 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1436,7 +1436,7 @@ static const char* OP_ChatOptionsTooltips[] = "Width of chat box.", "Height of chat box.", "Center text in the chat message pop ups.", - "Chatbox background.", + "Background for the chat message pop ups.", "Fadeout time for new chat message.", "Spam protection for in-game chat.", "Maxiumum amount of chat messages to look back at.", From 7f9d70285d619290deb2c61e4910407a5c834d8d Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 18:53:14 +0200 Subject: [PATCH 15/30] add new chat stuff to menus + show chat box when hovering over some things very ugly but i dont care, the hud stuff is done similar just hoping this doesent explode or whatever --- src/hu_stuff.c | 29 ++++++++++++----- src/m_menu.c | 6 ++++ src/m_menu.h | 2 +- src/m_menudefs.c | 83 +++++++++++++++++++++++++++++------------------- 4 files changed, 79 insertions(+), 41 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 0013900f6..77931550d 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2291,7 +2291,22 @@ void HU_DrawSongCredits(void) } } +static void HU_ForceShowChat(void) +{ + // only matters for non console chat + // see m_menu for how forceshowchat is set + if (!chat_on && forceshowchat) + { + // only print this if theres nothing in chat already + if (chat_nummsg_log == 0) + { + HU_AddChatText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", false); + } + HU_DrawChat(); + } +} + // Heads up displays drawer, call each frame // void HU_Drawer(void) @@ -2299,6 +2314,8 @@ void HU_Drawer(void) if (cv_vhseffect.value && ((paused && !camera[R_GetViewNumber()].freecam) || (demo.playback && cv_playbackspeed.value > 1))) V_DrawVhsEffect(demo.rewinding); + HU_ForceShowChat(); + // draw chat string plus cursor if (chat_on) { @@ -2378,8 +2395,7 @@ void HU_Drawer(void) // IN-LEVEL MULTIPLAYER RANKINGS //====================================================================== -static int -Ping_gfx_num (int lag) +static int Ping_gfx_num(int lag) { if (lag < 2) return 0; @@ -2393,8 +2409,7 @@ Ping_gfx_num (int lag) return 4; } -static int -Ping_gfx_color (UINT32 lag) +static int Ping_gfx_color(UINT32 lag) { if (lag < 2) return SKINCOLOR_JAWZ; @@ -2417,8 +2432,7 @@ Ping_gfx_color (UINT32 lag) return SKINCOLOR_WHITE; // to make the flashing work } -static const UINT8 * -Ping_gfx_colormap (UINT32 lag, boolean gentleman) +static const UINT8 *Ping_gfx_colormap(UINT32 lag, boolean gentleman) { const UINT8 *colormap = NULL; @@ -2438,8 +2452,7 @@ Ping_gfx_colormap (UINT32 lag, boolean gentleman) return colormap; } -static UINT32 -Ping_conversion (UINT32 lag) +static UINT32 Ping_conversion(UINT32 lag) { if (cv_pingmeasurement.value) { diff --git a/src/m_menu.c b/src/m_menu.c index 9e7a7b1c1..f8742c35f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -411,6 +411,7 @@ static INT32 M_GetFirstLevelInList(void); // crap to force hud to show when in saturns hud options boolean forceshowhud = false; +boolean forceshowchat = false; // smol text indicating if game is modified // so ppl dont wonder where their ra times went and stuff @@ -1599,6 +1600,9 @@ static boolean ShouldDrawMenuBG(void) if (forceshowhud) return false; + if (forceshowchat) + return false; + // camera options stuff, only do when in level if (gamestate == GS_LEVEL && (currentMenu == &OP_CamOptionsDef || currentMenu == &OP_Player1CamOptionsDef @@ -1619,7 +1623,9 @@ void M_Drawer(void) if (currentMenu == &MessageDef) menuactive = true; + // pain and suffering forceshowhud = (gamestate == GS_LEVEL && menuactive && (currentMenu == &OP_SaturnHudDef || currentMenu == &OP_HudOffsetDef || currentMenu == &OP_NametagDef || currentMenu == &OP_DriftGaugeDef)); // holy fuick + forceshowchat = (gamestate == GS_LEVEL && menuactive && currentMenu == &OP_ChatOptionsDef && (!OLDCHAT) && (itemOn == op_chat_boxwidth || itemOn == op_chat_boxheight || itemOn == op_chat_xoffs || itemOn == op_chat_yoffs)); // man i dont gaf anymore lmao if (menuactive) { diff --git a/src/m_menu.h b/src/m_menu.h index b1070bdc5..c8fe7b4c2 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -26,7 +26,7 @@ extern "C" { #include "mserv.h" #include "r_things.h" // for SKINNAMESIZE -extern boolean forceshowhud; +extern boolean forceshowhud, forceshowchat; // // MENUS diff --git a/src/m_menudefs.c b/src/m_menudefs.c index c06df7a26..ffb47ded4 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -446,25 +446,25 @@ enum static menuitem_t SP_ReplayMenu[] = { - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 90}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Lap", M_ReplayTimeAttack, 98}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 90}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Lap", M_ReplayTimeAttack, 98}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack, 106}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack, 114}, - {IT_WHITESTRING|IT_KEYHANDLER, NULL, "Replay Staff",M_HandleStaffReplay,122}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack, 106}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack, 114}, + {IT_WHITESTRING|IT_KEYHANDLER, NULL, "Replay Staff",M_HandleStaffReplay, 122}, - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} + {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} }; static menuitem_t SP_GuestReplayMenu[] = { - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay, 94}, - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Lap as Guest", M_SetGuestReplay,102}, - {IT_WHITESTRING|IT_CALL, NULL, "Save Last as Guest", M_SetGuestReplay,110}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay, 94}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Best Lap as Guest", M_SetGuestReplay, 102}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Last as Guest", M_SetGuestReplay, 110}, - {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay,120}, + {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay, 120}, - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} + {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} }; static menuitem_t SP_GhostMenu[] = @@ -1010,7 +1010,6 @@ enum #endif }; - #ifdef HWRENDER static menuitem_t OP_OpenGLOptionsMenu[] = { @@ -1067,7 +1066,6 @@ enum op_gl_shearing, op_gl_renderdist, }; - #endif static menuitem_t OP_SoundOptionsMenu[] = @@ -1078,8 +1076,7 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING|IT_CVAR|IT_CV_NOPRINT, NULL, "Music", &cv_gamedigimusic, 30}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Music Volume", &cv_digmusicvolume, 38}, -//#ifndef NO_MIDI -#if 0 +#if 0 //#ifndef NO_MIDI {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "MIDI Volume", &cv_midimusicvolume, 46}, {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 60}, @@ -1114,8 +1111,7 @@ static const char* OP_SoundTooltips[] = "Volume of Sound effects.", "Turn Music on or off.", "Volume of Music.", -//#ifndef NO_MIDI -#if 0 +#if 0 //#ifndef NO_MIDI "Volume of Midi Music.", #endif "Reverse left and right channels of audio.", @@ -1409,32 +1405,36 @@ static const char* OP_PlayerCamOptionsTooltips[] = static menuitem_t OP_ChatOptionsMenu[] = { // will ANYONE who doesn't know how to use the console want to touch this one? - {IT_STRING | IT_CVAR, NULL, "Chat Mode", &cv_consolechat, 5}, // nonetheless... + {IT_STRING | IT_CVAR, NULL, "Chat Mode", &cv_consolechat, 5}, // nonetheless... {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Chat Box Width", &cv_chatwidth, 20}, + NULL, "Chat Box Width", &cv_chatwidth, 20}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Chat Box Height", &cv_chatheight, 30}, - {IT_STRING | IT_CVAR, NULL, "Center Text in Chat", &cv_chatcentertext, 40}, + NULL, "Chat Box Height", &cv_chatheight, 30}, + {IT_STRING | IT_CVAR, NULL, "Chat Horizontal Offset", &cv_chat_xoffset, 40}, + {IT_STRING | IT_CVAR, NULL, "Chat Vertical Offset", &cv_chat_yoffset, 50}, - {IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 55}, - {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 65}, - {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 75}, - {IT_STRING | IT_CVAR, NULL, "Max Chat Messages", &cv_chatlogsize, 85}, + {IT_STRING | IT_CVAR, NULL, "Center Text in Chat", &cv_chatcentertext, 70}, + {IT_STRING | IT_CVAR, NULL, "Chat Background Tint", &cv_chatbacktint, 80}, + {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 90}, + {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 100}, + {IT_STRING | IT_CVAR, NULL, "Max Chat Messages", &cv_chatlogsize, 110}, - {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 105}, // shows ping above the framerate if we want to. - {IT_STRING | IT_CVAR, NULL, "Ping display style", &cv_pingstyle, 115}, - {IT_STRING | IT_CVAR, NULL, "Ping measurement", &cv_pingmeasurement, 125}, - {IT_STRING | IT_CVAR, NULL, "Ping icon", &cv_pingicon, 135}, + {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 130}, // shows ping above the framerate if we want to. + {IT_STRING | IT_CVAR, NULL, "Ping display style", &cv_pingstyle, 140}, + {IT_STRING | IT_CVAR, NULL, "Ping measurement", &cv_pingmeasurement, 150}, + {IT_STRING | IT_CVAR, NULL, "Ping icon", &cv_pingicon, 160}, - {IT_STRING | IT_CVAR, NULL, "Show IP address in playerlist", &cv_shownodeip, 145}, + {IT_STRING | IT_CVAR, NULL, "Show IP address in playerlist", &cv_shownodeip, 170}, }; static const char* OP_ChatOptionsTooltips[] = { "Chat mode used for in-game chat.", - "Width of chat box.", - "Height of chat box.", + "Width of the chat box.", + "Height of the chat box.", + "Horizontal Offset of the chat box.", + "Vertical Offset of the chat box.", "Center text in the chat message pop ups.", "Background for the chat message pop ups.", "Fadeout time for new chat message.", @@ -1447,6 +1447,25 @@ static const char* OP_ChatOptionsTooltips[] = "Should Player IP addresses be printed when using\nthe nodes or listplayers command?", }; +enum +{ + op_chat_mode, + op_chat_boxwidth, + op_chat_boxheight, + op_chat_yoffs, + op_chat_xoffs, + op_chat_centertxt, + op_chat_bgtint, + op_chat_fadetime, + op_chat_spamprotect, + op_chat_maxmsg, + op_chat_showping, + op_chat_pingstyle, + op_chat_pingmeasr, + op_chat_pingico, + op_chat_nodeip, +}; + static menuitem_t OP_GameOptionsMenu[] = { {IT_STRING | IT_SUBMENU, NULL, "Random Item Toggles...", &OP_MonitorToggleDef, 10}, From 352d1faacfd058699c29d5cc7f33f48122f9c7dc Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 18:59:21 +0200 Subject: [PATCH 16/30] forgor cv_chat_showlimit :chaosleep: --- src/m_menu.c | 10 ++++++---- src/m_menudefs.c | 13 ++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index f8742c35f..dc4cbcc87 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1605,9 +1605,11 @@ static boolean ShouldDrawMenuBG(void) // camera options stuff, only do when in level if (gamestate == GS_LEVEL && - (currentMenu == &OP_CamOptionsDef || currentMenu == &OP_Player1CamOptionsDef - || currentMenu == &OP_Player2CamOptionsDef || currentMenu == &OP_Player3CamOptionsDef - || currentMenu == &OP_Player4CamOptionsDef)) + (currentMenu == &OP_CamOptionsDef || + currentMenu == &OP_Player1CamOptionsDef || + currentMenu == &OP_Player2CamOptionsDef || + currentMenu == &OP_Player3CamOptionsDef || + currentMenu == &OP_Player4CamOptionsDef)) return false; return true; @@ -1625,7 +1627,7 @@ void M_Drawer(void) // pain and suffering forceshowhud = (gamestate == GS_LEVEL && menuactive && (currentMenu == &OP_SaturnHudDef || currentMenu == &OP_HudOffsetDef || currentMenu == &OP_NametagDef || currentMenu == &OP_DriftGaugeDef)); // holy fuick - forceshowchat = (gamestate == GS_LEVEL && menuactive && currentMenu == &OP_ChatOptionsDef && (!OLDCHAT) && (itemOn == op_chat_boxwidth || itemOn == op_chat_boxheight || itemOn == op_chat_xoffs || itemOn == op_chat_yoffs)); // man i dont gaf anymore lmao + forceshowchat = (gamestate == GS_LEVEL && menuactive && currentMenu == &OP_ChatOptionsDef && (!OLDCHAT) && (itemOn == op_chat_boxwidth || itemOn == op_chat_boxheight || itemOn == op_chat_xoffs || itemOn == op_chat_yoffs || itemOn == op_chat_charlmt)); // man i dont gaf anymore lmao if (menuactive) { diff --git a/src/m_menudefs.c b/src/m_menudefs.c index ffb47ded4..7eecdb0f6 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1419,13 +1419,14 @@ static menuitem_t OP_ChatOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 90}, {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 100}, {IT_STRING | IT_CVAR, NULL, "Max Chat Messages", &cv_chatlogsize, 110}, + {IT_STRING | IT_CVAR, NULL, "Display Character Limit", &cv_chat_showlimit, 120}, - {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 130}, // shows ping above the framerate if we want to. - {IT_STRING | IT_CVAR, NULL, "Ping display style", &cv_pingstyle, 140}, - {IT_STRING | IT_CVAR, NULL, "Ping measurement", &cv_pingmeasurement, 150}, - {IT_STRING | IT_CVAR, NULL, "Ping icon", &cv_pingicon, 160}, + {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 140}, // shows ping above the framerate if we want to. + {IT_STRING | IT_CVAR, NULL, "Ping display style", &cv_pingstyle, 150}, + {IT_STRING | IT_CVAR, NULL, "Ping measurement", &cv_pingmeasurement, 160}, + {IT_STRING | IT_CVAR, NULL, "Ping icon", &cv_pingicon, 170}, - {IT_STRING | IT_CVAR, NULL, "Show IP address in playerlist", &cv_shownodeip, 170}, + {IT_STRING | IT_CVAR, NULL, "Show IP address in playerlist", &cv_shownodeip, 180}, }; static const char* OP_ChatOptionsTooltips[] = @@ -1440,6 +1441,7 @@ static const char* OP_ChatOptionsTooltips[] = "Fadeout time for new chat message.", "Spam protection for in-game chat.", "Maxiumum amount of chat messages to look back at.", + "Show how many characters you have left to type in the chat.", "Show player ping.", "Choose the style of the ping display.", "Measurement used for ping.", @@ -1459,6 +1461,7 @@ enum op_chat_fadetime, op_chat_spamprotect, op_chat_maxmsg, + op_chat_charlmt, op_chat_showping, op_chat_pingstyle, op_chat_pingmeasr, From 80e4d02c51cd4a5a5bb60b554434a4d0869ba6a6 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 21:02:10 +0200 Subject: [PATCH 17/30] dont skip intro sounds if music is disabled --- src/s_sound.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/s_sound.c b/src/s_sound.c index a95fc39c0..050b2c932 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2039,6 +2039,10 @@ static boolean S_SkipIntroMusic(void) if (!cv_skipintromusic.value) return false; + // dont skip if we disabled music, weird? but this would skip sounds that play on map start as well otherwise + if (music_disabled) + return false; + // check if menu music is playing, otherwise it may continue playing if (fasticmp(music.name, "titles")) return false; @@ -2050,6 +2054,11 @@ static boolean S_SkipIntroMusic(void) return false; } + // without sound there wont be any intro playing + if (sound_disabled) + return true; + // yes i sometimes play with only music but no sound + return true; } From 1bcadf3c46839d68ba1a4d3e5e3d701a559b1ff3 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 22:23:25 +0200 Subject: [PATCH 18/30] fix the lap emblem animation thingie --- src/k_hud.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/k_hud.c b/src/k_hud.c index 0ad2d3b3f..0e3afb67d 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -4397,6 +4397,9 @@ static void K_drawChallengerScreen(void) static void K_drawLapStartAnim(void) { + if (!cv_showlapemblem.value) + return; + // This is an EVEN MORE insanely complicated animation. const UINT8 progress = 80-stplyr->kartstuff[k_lapanimation]; UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE); @@ -4440,9 +4443,10 @@ static void K_drawLapStartAnim(void) V_DrawFixedPatch(leftx, y, FRACUNIT, vflags, kp_lapanim_lap[min(progress/2, 6)], NULL); char *lapnum = va("%02d", stplyr->laps + 1); - const size_t laplength = strlen(lapnum); - for (size_t i = 0; i < laplength; i++) + const int laplength = (int)strlen(lapnum); + + for (int i = 0; i < laplength; i++) { int digit = lapnum[i] - '0'; int frame = min(2, progress/2 - 8 - (i*2)); @@ -4824,7 +4828,7 @@ void K_drawKartHUD(void) { if (stplyr->exiting) K_drawKartFinish(); - else if (stplyr->kartstuff[k_lapanimation] && !splitscreen && cv_showlapemblem.value) + else if (stplyr->kartstuff[k_lapanimation] && !splitscreen) K_drawLapStartAnim(); } From d687be4997caca9ac5d6ccb568e3414b60671175 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 22:34:02 +0200 Subject: [PATCH 19/30] change K_GetSpeedometerStyle to unsinged does not need be signed most other things will cache this into an uint8 eitherway --- src/k_hud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_hud.c b/src/k_hud.c index 0e3afb67d..0deb8f0f5 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -1146,7 +1146,7 @@ enum SPEEDO_PMETERSMOL, }; -static SINT8 K_GetSpeedometerStyle(void) +static UINT8 K_GetSpeedometerStyle(void) { if (cv_newspeedometer.value == 2 && xtra_speedo) return SPEEDO_EXTRA; From 4b8f998c85a6899b0d5a9e12f47f17f98631ef7e Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 28 Jun 2026 22:58:11 +0200 Subject: [PATCH 20/30] cast this crap --- src/p_setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index fe583b406..6d790262e 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -456,10 +456,10 @@ static void P_SetupDirectionalLight(void) if (gamemap != oldmap || encoremode != oldencore || reinitmaplight) { - lighting->light_contrast = M_RandomRange(0, 58); + lighting->light_contrast = (UINT8)M_RandomRange(0, 58); lighting->sprite_backlight = 0; - lighting->use_light_angle = M_RandomRange(0, 1); // either on or off - lighting->light_angle = M_RandomRange(-382, 382); + lighting->use_light_angle = (boolean)M_RandomRange(0, 1); // either on or off + lighting->light_angle = (angle_t)M_RandomRange(-382, 382); reinitmaplight = false; } From ea76af5a816ae7323a3fe328a3ce902024110467 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 01:46:30 +0200 Subject: [PATCH 21/30] seenames is stupid keep that ashnal utils breaks without this crap --- src/doomdef.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index d4c9d63fa..b57ab0bfb 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -678,7 +678,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; #ifndef COMPAT_VANILLA #define SATURNJOIN #define SATURNPAK - #undef SEENAMES #endif #ifdef __cplusplus From 4eb108e0a699f4770aa4daa3579252257a2d524d Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 02:13:47 +0200 Subject: [PATCH 22/30] add sound thing for reference does nothing cause it sucks maybe someone else has a better idea what to do here --- src/p_map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index 06e666a28..c620fc292 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2592,6 +2592,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) positives, so just ignore them entirely. */ if (stairjank && !oldslope && !thing->standingslope && thing->player && !thing->player->spectator) { + /* use a shorter sound if not two tics have passed + * since the last step */ + //S_ReducedVFXSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268), NULL); + //S_StartSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268)); + // sound does not work out all that well for kart maps + // TODO: maybe spawn smol dust effect similar to RR? /*if (!thing->player->stairjank) { From f43a4a2eb619ce44555a6d7b0548adf565c5efa9 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 02:14:45 +0200 Subject: [PATCH 23/30] have gametype i_error actually print the invalid gametype bit more informative ig? --- src/d_clisrv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 492dd0ac4..8cb038251 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -841,11 +841,13 @@ static void resynch_write_ctf(resynchend_pak *rst) rst->flagplayer[i] = (SINT8)j; break; } + if (j == MAXPLAYERS) // fine, no I_Error { CONS_Alert(CONS_ERROR, "One of the flags has gone completely missing...\n"); rst->flagplayer[i] = -2; } + continue; } @@ -1135,6 +1137,7 @@ static void CV_SavePlayerNames(UINT8 **p) WRITEUINT8(*p, 0); continue; } + WRITESTRING(*p, player_names[i]); } } @@ -1148,10 +1151,13 @@ static void CV_LoadPlayerNames(UINT8 **p) for (; i < MAXPLAYERS; ++i) { READSTRING(*p, tmp_name); + if (tmp_name[0] == 0) continue; + if (tmp_name[MAXPLAYERNAME]) // overflow detected I_Error("Received bad server config packet when trying to join"); + memcpy(player_names[i], tmp_name, MAXPLAYERNAME+1); } } @@ -2029,6 +2035,7 @@ static void SV_SendSaveGame(INT32 node, boolean resending) P_SaveNetGame(&save, resending); length = save.p - save.buffer; + if (length > SAVEGAMESIZE) { Z_Free(save.buffer); @@ -5401,7 +5408,7 @@ static void PT_ServerCFG(SINT8 node) { maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic); if ((gametype = netbuffer->u.servercfg.gametype) >= NUMGAMETYPES) - I_Error("Bad gametype in cliserv!"); + I_Error("Bad gametype %d in cliserv!", gametype); modifiedgame = netbuffer->u.servercfg.modifiedgame; for (j = 0; j < MAXPLAYERS; j++) adminplayers[j] = netbuffer->u.servercfg.adminplayers[j]; From 00aa023e9eca184d2476a1294d85a943dde81193 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 14:42:58 +0200 Subject: [PATCH 24/30] cleanup p_setup a bit again --- src/m_menu.c | 28 +++---- src/p_setup.c | 208 ++++++++++++++++++++++++++++++-------------------- src/p_spec.c | 10 ++- 3 files changed, 148 insertions(+), 98 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index dc4cbcc87..cf9f433e6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -212,12 +212,12 @@ static INT32 setupm_fakeskin; static INT32 setupm_fakecolor; static UINT8 setupm_pselect = 1; -//variables used for other skin select menus +// variables used for other skin select menus static UINT8 setupm_skinypos; static INT32 setupm_skinselect; static boolean setupm_skinlockedselect; -static UINT8 setupm_playernum; //brap +static UINT8 setupm_playernum; // brap // Addons Menu: Local mode static void M_LocalAddons(INT32 choice); @@ -450,13 +450,13 @@ consvar_t cv_showallmaps = {"showallmaps", "No", CV_SAVE, CV_YesNo, NULL, 0, NUL consvar_t cv_showmusicfilename = {"showmusicfilename", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t serversort_cons_t[] = { - {0,"Ping"}, - {1,"Modified State"}, - {2,"Most Players"}, - {3,"Least Players"}, - {4,"Max Player Slots"}, - {5,"Gametype"}, - {0,NULL} + {0, "Ping"}, + {1, "Modified State"}, + {2, "Most Players"}, + {3, "Least Players"}, + {4, "Max Player Slots"}, + {5, "Gametype"}, + {0, NULL} }; consvar_t cv_serversort = {"serversort", "Ping", CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL}; @@ -705,7 +705,7 @@ static void Dummystaff_OnChange(void) dummystaffname[0] = '\0'; - if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(cv_nextmap.value)))) == LUMPERROR) + if ((l = W_CheckNumForName(va("%sS01", G_BuildMapName(cv_nextmap.value)))) == LUMPERROR) { CV_StealthSetValue(&cv_dummystaff, 0); return; @@ -714,7 +714,7 @@ static void Dummystaff_OnChange(void) { char *temp = dummystaffname; UINT8 numstaff = 1; - while (numstaff < 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value),numstaff+1))) != LUMPERROR) + while (numstaff < 99 && (l = W_CheckNumForName(va("%sS%02u", G_BuildMapName(cv_nextmap.value), numstaff+1))) != LUMPERROR) numstaff++; if (cv_dummystaff.value < 1) @@ -722,7 +722,7 @@ static void Dummystaff_OnChange(void) else if (cv_dummystaff.value > numstaff) CV_StealthSetValue(&cv_dummystaff, 1); - if ((l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value), cv_dummystaff.value))) == LUMPERROR) + if ((l = W_CheckNumForName(va("%sS%02u", G_BuildMapName(cv_nextmap.value), cv_dummystaff.value))) == LUMPERROR) return; // shouldn't happen but might as well check... G_UpdateStaffGhostName(l); @@ -807,7 +807,8 @@ static void M_ChangeCvar(INT32 choice) CV_SetValue(cv,skins[skinno].prefcolor); return; } - CV_Set(cv,cv->defaultvalue); + + CV_Set(cv, cv->defaultvalue); return; } @@ -956,6 +957,7 @@ static void Command_Manual_f(void) { if (modeattacking) return; + M_StartControlPanel(); M_Manual(INT32_MAX); itemOn = 0; diff --git a/src/p_setup.c b/src/p_setup.c index 6d790262e..bd43174f3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2559,6 +2559,24 @@ static void P_LoadRecordGhosts(void) free(gpath); } +static void P_ResetSpawnpoints(void) +{ + UINT8 i; + + numdmstarts = numredctfstarts = numbluectfstarts = 0; + + // reset the player starts + for (i = 0; i < MAXPLAYERS; i++) + { + playerstarts[i] = NULL; + } + + for (i = 0; i < 2; i++) + { + skyboxmo[i] = NULL; + } +} + static void P_InitCamera(void) { INT32 i; @@ -2568,6 +2586,7 @@ static void P_InitCamera(void) for (i = 0; i <= splitscreen; i++) { + camera[i].postimg = 0; P_SetupCamera(&camera[i]); } @@ -2667,10 +2686,14 @@ static boolean P_RunSpecialWipe(boolean reloadinggamestate) { // Cancel all d_main.c fadeouts (keep fade in though). if (reloadinggamestate) + { wipegamestate = gamestate; // Don't fade if reloading the gamestate + return false; + } + // Encore mode fade to pink to white // This is handled BEFORE sounds are stopped. - else if (encoremode && !prevencoremode && !demo.rewinding) + if (encoremode && !prevencoremode && !demo.rewinding) { tic_t locstarttime, endtime, nowtime; @@ -2704,6 +2727,8 @@ static boolean P_RunSpecialWipe(boolean reloadinggamestate) // Hold on white for extra effect. while (nowtime < endtime) { + I_HandleInterrupt(); + // wait loop while (!((nowtime = I_GetTime()) - lastwipetic)) { @@ -2726,6 +2751,69 @@ static boolean P_RunSpecialWipe(boolean reloadinggamestate) return false; } +static void P_InitTagGametype(void) +{ + UINT8 i; + INT32 realnumplayers = 0; + INT32 playersactive[MAXPLAYERS]; + + //I just realized how problematic this code can be. + //D_NumPlayers() will not always cover the scope of the netgame. + //What if one player is node 0 and the other node 31? + //The solution? Make a temp array of all players that are currently playing and pick from them. + //Future todo? When a player leaves, shift all nodes down so D_NumPlayers() can be used as intended? + //Also, you'd never have to loop through all 32 players slots to find anything ever again. + for (i = 0; i < MAXPLAYERS; i++) + { + if (playeringame[i] && !players[i].spectator) + { + playersactive[realnumplayers] = i; //stores the player's node in the array. + realnumplayers++; + } + } + + if (!realnumplayers) // this should also fix the dedicated crash bug. You only pick a player if one exists to be picked. + { + CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n")); + return; + } + + i = P_RandomKey(realnumplayers); + players[playersactive[i]].pflags |= PF_TAGIT; //choose our initial tagger before map starts. + + // Taken and modified from G_DoReborn() + // Remove the player so he can respawn elsewhere. + // first dissasociate the corpse + if (players[playersactive[i]].mo) + P_RemoveMobj(players[playersactive[i]].mo); + + G_SpawnPlayer(playersactive[i], false); //respawn the lucky player in his dedicated spawn location. +} + +static void P_InitGametype(void) +{ + if (modeattacking == ATTACKING_RECORD && !demo.playback) + P_LoadRecordGhosts(); + + if (G_RaceGametype() && server) + { + INT32 numLaps; + const mapheader_t *mapheader = mapheaderinfo[gamemap - 1]; + + if ((netgame || multiplayer) && cv_basenumlaps.value && + (!(mapheader->levelflags & LF_SECTIONRACE) || (mapheader->numlaps > cv_basenumlaps.value))) + numLaps = cv_basenumlaps.value; + else + numLaps = mapheader->numlaps; + + CV_StealthSetValue(&cv_numlaps, numLaps); + } + else if (G_TagGametype()) + { + P_InitTagGametype(); + } +} + static void P_SetupPlayer(void) { INT32 i; @@ -2752,63 +2840,14 @@ static void P_SetupPlayer(void) } } - if (modeattacking == ATTACKING_RECORD && !demo.playback) - P_LoadRecordGhosts(); - - if (G_TagGametype()) - { - INT32 realnumplayers = 0; - INT32 playersactive[MAXPLAYERS]; - - //I just realized how problematic this code can be. - //D_NumPlayers() will not always cover the scope of the netgame. - //What if one player is node 0 and the other node 31? - //The solution? Make a temp array of all players that are currently playing and pick from them. - //Future todo? When a player leaves, shift all nodes down so D_NumPlayers() can be used as intended? - //Also, you'd never have to loop through all 32 players slots to find anything ever again. - for (i = 0; i < MAXPLAYERS; i++) - { - if (playeringame[i] && !players[i].spectator) - { - playersactive[realnumplayers] = i; //stores the player's node in the array. - realnumplayers++; - } - } - - if (realnumplayers) // this should also fix the dedicated crash bug. You only pick a player if one exists to be picked. - { - i = P_RandomKey(realnumplayers); - players[playersactive[i]].pflags |= PF_TAGIT; //choose our initial tagger before map starts. - - // Taken and modified from G_DoReborn() - // Remove the player so he can respawn elsewhere. - // first dissasociate the corpse - if (players[playersactive[i]].mo) - P_RemoveMobj(players[playersactive[i]].mo); - - G_SpawnPlayer(playersactive[i], false); //respawn the lucky player in his dedicated spawn location. - } - else - CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n")); - - } - else if (G_RaceGametype() && server) - { - INT32 numLaps = ((netgame || multiplayer) && cv_basenumlaps.value - && (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) - || (mapheaderinfo[gamemap - 1]->numlaps > cv_basenumlaps.value))) - ? cv_basenumlaps.value - : mapheaderinfo[gamemap - 1]->numlaps; - - CV_StealthSetValue(&cv_numlaps, numLaps); - } + P_InitGametype(); // Start recording replay in multiplayer with a temp filename // Ensure dedis only record a replay if there is a player at the start of the map, otherwise we get invalid replays! if (!demo.playback && multiplayer && D_NumPlayers()) { static char buf[256]; - sprintf(buf, "replay"PATHSEP"online"PATHSEP"%d-%s", (int) (time(NULL)), G_BuildMapName(gamemap)); + sprintf(buf, "replay"PATHSEP"online"PATHSEP"%d-%s", (int)(time(NULL)), G_BuildMapName(gamemap)); I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); I_mkdir(va("%s"PATHSEP"replay"PATHSEP"online", srb2home), 0755); @@ -2910,9 +2949,10 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) // 99% of the things already did, so. // Map header should always be in place at this point INT32 i; + UINT8 levelfadecol; boolean ranspecialwipe = false; lumpnum_t encoreLump = LUMPERROR; - UINT8 levelfadecol; + const mapheader_t *mapheader = mapheaderinfo[gamemap - 1]; midgamejoin = fromnetsave; // makes dynslopes run in P_Ticker to avoid synch issues and other stuff @@ -2920,7 +2960,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) levelloading = true; // This is needed. Don't touch. - maptol = mapheaderinfo[gamemap-1]->typeoflevel; + maptol = mapheader->typeoflevel; CON_Drawer(); // let the user know what we are going to do I_FinishUpdate(); // page flip or blit buffer @@ -2931,17 +2971,17 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) // Clear CECHO messages HU_ClearCEcho(); - if (mapheaderinfo[gamemap-1]->runsoc[0] != '#') - P_RunSOC(mapheaderinfo[gamemap-1]->runsoc); + if (mapheader->runsoc[0] != '#') + P_RunSOC(mapheader->runsoc); - if (cv_runscripts.value && mapheaderinfo[gamemap-1]->scriptname[0] != '#') - P_RunLevelScript(mapheaderinfo[gamemap-1]->scriptname); + if (cv_runscripts.value && mapheader->scriptname[0] != '#') + P_RunLevelScript(mapheader->scriptname); P_LevelInitStuff(reloadinggamestate); - if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0' - && atoi(mapheaderinfo[gamemap-1]->forcecharacter) != 255) - P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter); + if (mapheader->forcecharacter[0] != '\0' + && atoi(mapheader->forcecharacter) != 255) + P_ForceCharacter(mapheader->forcecharacter); // Initial height of PointOfView // will be set by player think. @@ -2991,10 +3031,10 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) char tx[64]; V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to...")); snprintf(tx, 63, "%s%s%s", - mapheaderinfo[gamemap-1]->lvlttl, - (strlen(mapheaderinfo[gamemap-1]->zonttl) > 0) ? va(" %s",mapheaderinfo[gamemap-1]->zonttl) : // SRB2kart - ((mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " Zone"), - (strlen(mapheaderinfo[gamemap-1]->actnum) > 0) ? va(", Act %s",mapheaderinfo[gamemap-1]->actnum) : ""); + mapheader->lvlttl, + (strlen(mapheader->zonttl) > 0) ? va(" %s",mapheader->zonttl) : // SRB2kart + ((mapheader->levelflags & LF_NOZONE) ? "" : " Zone"), + (strlen(mapheader->actnum) > 0) ? va(", Act %s",mapheader->actnum) : ""); V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx); I_UpdateNoVsync(); }*/ @@ -3013,20 +3053,16 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) curmapvirt = vres_GetMap(lastloadedmaplumpnum); encoreLump = W_CheckNumForName(va("%s%c", maplumpname, (encoremode ? 'E' : 'T'))); - R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette, encoreLump); + R_ReInitColormaps(mapheader->palette, encoreLump); CON_SetupBackColormap(); // SRB2 determines the sky texture to be used depending on the map header. - P_SetupLevelSky(mapheaderinfo[gamemap-1]->skynum, true); + P_SetupLevelSky(mapheader->skynum, true); - numdmstarts = numredctfstarts = numbluectfstarts = 0; + P_ResetSpawnpoints(); - // reset the player starts - memset(playerstarts, 0, sizeof(playerstarts)); - memset(skyboxmo, 0, sizeof(skyboxmo)); - - P_MapStart(); + P_MapStart(); // tmthing can be used starting from this point P_LoadMapFromFile(); @@ -3046,7 +3082,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) if (!playerstarts[numcoopstarts]) break; - globalweather = mapheaderinfo[gamemap-1]->weather; + globalweather = mapheader->weather; // set up world state P_SpawnSpecials(fromnetsave, reloadinggamestate); @@ -3093,7 +3129,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) // clear special respawning que iquehead = iquetail = 0; - P_MapEnd(); + P_MapEnd(); // tmthing is no longer needed from this point onwards // Remove the loading shit from the screen if (rendermode != render_none && !reloadinggamestate) @@ -3124,9 +3160,15 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) savedata.lives = 0; } - // assume the skybox is visible on level load. - skyVisible = true; - memset(skyVisiblePerPlayer, true, sizeof(skyVisiblePerPlayer)); + if (!reloadinggamestate) + { + // assume the skybox is visible on level load. + skyVisible = true; + for (i = 0; i < MAXSPLITSCREENPLAYERS; i++) + { + skyVisiblePerPlayer[i] = true; + } + } if (!fromnetsave) // uglier hack { // to make a newly loaded level start on the second frame. @@ -3146,14 +3188,18 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate) LUA_HookInt(gamemap, HOOK(MapLoad)); } - if (rendermode != render_none && !reloadinggamestate) + // reloading gamestate, stop here. + if (reloadinggamestate) + return true; + + G_AddMapToBuffer(gamemap-1); + + if (rendermode != render_none) { R_ResetViewInterpolation(0); R_UpdateMobjInterpolators(); } - G_AddMapToBuffer(gamemap-1); - G_ResetDeviceLED(); return true; diff --git a/src/p_spec.c b/src/p_spec.c index 1bcbebdf5..9aff26b3c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -538,6 +538,7 @@ static sector_t *getNextSector(line_t *line, sector_t *sec) else return NULL; } + return line->frontsector; } @@ -568,6 +569,7 @@ fixed_t P_FindLowestFloorSurrounding(sector_t *sec) if (other->floorheight < floorh) floorh = other->floorheight; } + return floorh; } @@ -1180,7 +1182,7 @@ INT32 P_FindMinSurroundingLight(sector_t *sector, INT32 max) for (i = 0; i < sector->linecount; i++) { line = sector->lines[i]; - check = getNextSector(line,sector); + check = getNextSector(line, sector); if (!check) continue; @@ -2098,7 +2100,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) ffloor_t *rover; boolean foundit = false; - for(rover = mo->subsector->sector->ffloors; rover; rover = rover->next) + for (rover = mo->subsector->sector->ffloors; rover; rover = rover->next) { if (rover->master->frontsector->tag != line->tag) continue; @@ -2988,10 +2990,10 @@ sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 n { fixed_t topheight, bottomheight; - if (GETSECSPECIAL(rover->master->frontsector->special, section) != number) + if (!(rover->flags & FF_EXISTS)) continue; - if (!(rover->flags & FF_EXISTS)) + if (GETSECSPECIAL(rover->master->frontsector->special, section) != number) continue; topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); From 65c2d2733ddc6aaedc60d8f9606267951c38f3c2 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 14:40:43 +0200 Subject: [PATCH 25/30] clear deathmatch and ctf spawnpoints aswell prob wont matter much for us but still better to not leave those dangling after map change --- src/p_setup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_setup.c b/src/p_setup.c index bd43174f3..ec1320aa5 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2569,6 +2569,13 @@ static void P_ResetSpawnpoints(void) for (i = 0; i < MAXPLAYERS; i++) { playerstarts[i] = NULL; + redctfstarts[i] = NULL; + bluectfstarts[i] = NULL; + } + + for (i = 0; i < MAX_DM_STARTS; i++) + { + deathmatchstarts[i] = NULL; } for (i = 0; i < 2; i++) From e12ecabcf0aab2284ce848192218576ee8c4fad8 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 15:35:37 +0200 Subject: [PATCH 26/30] revert some P_IsObjectOnGround pretty sure none of those cause issues currently, but rather not risk stuff as that condition might change from smth else in those cases its not an expensive call anyways really --- src/k_kart.c | 20 +++++++++----------- src/p_map.c | 2 +- src/p_mobj.c | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index e3306c629..eb58a7b62 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5019,9 +5019,7 @@ static void K_MoveHeldObjects(player_t *player) mobj_t *cur = player->mo->hnext; mobj_t *targ = player->mo; - const boolean ponground = P_IsObjectOnGround(player->mo); - - if (ponground && player->speed > 0) + if (player->speed > 0 && P_IsObjectOnGround(player->mo)) player->kartstuff[k_bananadrag]++; while (!P_MobjWasRemoved(cur)) @@ -5070,7 +5068,8 @@ static void K_MoveHeldObjects(player_t *player) cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy); - /*if (P_IsObjectOnGround(player->mo) && player->speed > 0 && player->kartstuff[k_bananadrag] > TICRATE + /*if (player->speed > 0 && P_IsObjectOnGround(player->mo) + && player->kartstuff[k_bananadrag] > TICRATE && P_RandomChance(min(FRACUNIT/2, FixedDiv(player->speed, K_GetKartSpeed(player, false))/2))) { if (leveltime & 1) @@ -5079,8 +5078,9 @@ static void K_MoveHeldObjects(player_t *player) targz -= 8*(2*FRACUNIT)/7; }*/ - if (cv_bananajitter.value && ponground - && player->speed > 0 && player->kartstuff[k_bananadrag] > TICRATE) + // "jitter" dragged bananas around + if (cv_bananajitter.value && + player->speed > 0 && P_IsObjectOnGround(player->mo) && player->kartstuff[k_bananadrag] > TICRATE) { const fixed_t halfpspeed = FixedDiv(player->speed, K_GetKartSpeed(player, false))/2; @@ -5581,8 +5581,6 @@ FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, bool */ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { - const boolean onground = P_IsObjectOnGround(player->mo); - K_UpdateOffroad(player); K_UpdateEngineSounds(player, cmd); // Thanks, VAda! @@ -5699,7 +5697,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_spinouttimer]) { - if ((onground || ((player->kartstuff[k_spinouttype]+1)/2 == 1)) // spinouttype 1 and 2 - explosion and spb + if ((P_IsObjectOnGround(player->mo) || ((player->kartstuff[k_spinouttype]+1)/2 == 1)) // spinouttype 1 and 2 - explosion and spb && (player->kartstuff[k_sneakertimer] == 0)) { player->kartstuff[k_spinouttimer]--; @@ -5798,7 +5796,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (G_BattleGametype() && player->kartstuff[k_bumper] > 0) player->kartstuff[k_wanted]++; - if (onground) + if (P_IsObjectOnGround(player->mo)) player->kartstuff[k_waterskip] = 0; if (player->kartstuff[k_instashield]) @@ -5842,7 +5840,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_comebacktimer]) player->kartstuff[k_comebackmode] = 0; - if (onground && player->kartstuff[k_pogospring]) + if (player->kartstuff[k_pogospring] && P_IsObjectOnGround(player->mo)) { if (P_MobjFlip(player->mo)*player->mo->momz <= 0) player->kartstuff[k_pogospring] = 0; diff --git a/src/p_map.c b/src/p_map.c index c620fc292..ef4997293 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2428,7 +2428,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) if (thing->player) { - if (special == -1) + if (special == -1) // this should use the target coords not the ones were started with, but cant fix that for compat reasons! special = GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1); // If using type Section1:13, double the maxstep. diff --git a/src/p_mobj.c b/src/p_mobj.c index 12574c031..49916eb50 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7068,7 +7068,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) } P_InstaThrust(mobj, mobj->angle, finalspeed); - + if (grounded) { sector_t *sec2 = P_ThingOnSpecial3DFloor(mobj); From 408db7a2eb627f51a70493e6075fea0966fe60ad Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 15:42:29 +0200 Subject: [PATCH 27/30] use G_KeynumToString for local addon menu key info just in case we change them dont have to change them everywhere --- src/m_menu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index cf9f433e6..38b5e2875 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -221,9 +221,11 @@ static UINT8 setupm_playernum; // brap // Addons Menu: Local mode static void M_LocalAddons(INT32 choice); -#define LOCALMODE_KEY (KEY_RALT) static boolean addons_localmode = false; +#define LOCALMODE_KEY (KEY_RALT) +#define AUTOLOAD_KEY (KEY_END) + // // PROTOTYPES // @@ -3673,10 +3675,10 @@ static void M_DrawAddons(void) //m = numwadfiles-(mainwads+2+1); //V_DrawCenteredString(BASEVIDWIDTH/2, y+24, (majormods ? highlightflags : V_TRANSLUCENT), va("%d ADD-ON%s LOADED", (int)m, (m == 1) ? "" : "S")); //+2 for music, sounds, +1 for main.kart - V_DrawThinString(0, BASEVIDHEIGHT-10, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_TRANSLUCENT|V_ALLOWLOWERCASE, ("END Key - Add addon to autoload")); + V_DrawThinString(0, BASEVIDHEIGHT-10, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s Key - Add addon to autoload", G_KeynumToString(AUTOLOAD_KEY))); if (Playing() && (server || IsPlayerAdmin(consoleplayer))) - V_DrawThinString(0, BASEVIDHEIGHT-20, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_TRANSLUCENT|V_ALLOWLOWERCASE, ("Right ALT Key - Switch to local addon mode")); + V_DrawThinString(0, BASEVIDHEIGHT-20, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s Key - Switch to local addon mode", G_KeynumToString(LOCALMODE_KEY))); } static void M_AddonExec(INT32 ch) @@ -3698,7 +3700,7 @@ static void M_AddonAutoLoad(INT32 ch) FILE *autoloadconfigfile; // check our controls // - if (ch != 'y' && ch != KEY_ENTER && ch != KEY_END) + if (ch != 'y' && ch != KEY_ENTER && ch != AUTOLOAD_KEY) { S_StartSound(NULL, sfx_s26d); return; @@ -3712,7 +3714,7 @@ static void M_AddonAutoLoad(INT32 ch) switch (dirmenu[dir_on[menudepthleft]][DIR_TYPE]) { case EXT_FOLDER: - M_StartMessage(va("%c%s\x80\nAutoloading folders is not supported as of yet. \n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING); + M_StartMessage(va("%c%s\x80\nAutoloading folders is not supported as of yet. \n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING), NULL, MM_NOTHING); break; case EXT_TXT: case EXT_CFG: @@ -3899,7 +3901,7 @@ static void M_HandleAddons(INT32 choice) } break; - case KEY_END: + case AUTOLOAD_KEY: { boolean refresh = true; if (!dirmenu[dir_on[menudepthleft]]) From d9e339cb5636b62b7a613805b305231010583250 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 18:13:17 +0200 Subject: [PATCH 28/30] toggable sound effect for stair jank not the biggest fan of it but idk how to make this better on stairs with lots of steps so this will do for now --- src/g_game.h | 1 + src/k_kart.c | 3 ++- src/m_menudefs.c | 35 ++++++++++++++++++++++++----------- src/p_map.c | 8 ++++++-- src/r_main.cpp | 1 + 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/g_game.h b/src/g_game.h index 4f46ef89d..6b2fae46d 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -119,6 +119,7 @@ extern consvar_t cv_gravstretch; extern consvar_t cv_sloperoll; extern consvar_t cv_sliptideroll; extern consvar_t cv_stairjank; +extern consvar_t cv_stairjanksfx; extern consvar_t cv_slamsound; extern consvar_t cv_sloperolldist; extern consvar_t cv_sparkroll; diff --git a/src/k_kart.c b/src/k_kart.c index eb58a7b62..027572458 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -67,7 +67,8 @@ static CV_PossibleValue_t sloperoll_cons_t[] = {{0, "Off"}, {1, "Players"}, {2, consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL, sloperoll_cons_t, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sparkroll = {"sparkroll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sliptideroll = {"sliptideroll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_stairjank = {"stairjank", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_stairjank = {"stairjank", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_stairjanksfx = {"stairjanksfx", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; //hardcode saltyhop mhhm static void saltyhop_onchange(void); diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 7eecdb0f6..72d3ab2f5 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1791,20 +1791,22 @@ static menuitem_t OP_PlayerDistortMenu[] = {IT_STRING | IT_CVAR, NULL, "Rotate Players when Sliptiding", &cv_sliptideroll, 25}, {IT_STRING | IT_CVAR, NULL, "Stair Janking Effect", &cv_stairjank, 30}, - {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 35}, - {IT_STRING | IT_CVAR, NULL, "Rotate Bananas on Throw", &cv_bananthrowroll, 40}, + {IT_STRING | IT_CVAR, NULL, "Stair Janking Sound Effect", &cv_stairjanksfx, 35}, // idk if that should be here but i dont care atm - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Player Stretch Factor", &cv_gravstretch, 50}, - {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 55}, + {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 40}, + {IT_STRING | IT_CVAR, NULL, "Rotate Bananas on Throw", &cv_bananthrowroll, 45}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 65}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saltyhop Height", &cv_saltyheight, 70}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 75}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 80}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Roll", &cv_saltyroll, 85}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Player Stretch Factor", &cv_gravstretch, 55}, + {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 60}, - {IT_STRING | IT_CVAR, NULL, "Squishdance", &cv_squishdance, 95}, - {IT_STRING | IT_CVAR, NULL, "Squishdance Speed", &cv_squishdancespeed, 101}, // why is this offset by 6? idk cant remember lulul + {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 70}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saltyhop Height", &cv_saltyheight, 75}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 80}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 85}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Roll", &cv_saltyroll, 90}, + + {IT_STRING | IT_CVAR, NULL, "Squishdance", &cv_squishdance, 100}, + {IT_STRING | IT_CVAR, NULL, "Squishdance Speed", &cv_squishdancespeed, 106}, // why is this offset by 6? idk cant remember lulul }; static const char* OP_PlayerDistortTooltips[] = @@ -1814,6 +1816,7 @@ static const char* OP_PlayerDistortTooltips[] = "Distance object rotation should be visable.", "Player rotation when sliptiding.", "Slightly tilt the player when driving over stairs or small bumps.", + "Sound effect when driving over stairs or small bumps.", "Rotation of a player's boost trails and drift sparks.", "Should banans rotate when thrown?\nAnd should they stay rotated when on the ground?", "Player squash and stretch.", @@ -1834,6 +1837,7 @@ enum slrotatedist, sliptide, stairjank, + stairjanksfx, sparkrotate, bananrotat, stretchyplayer, @@ -2742,6 +2746,15 @@ void PDistort_menu_Onchange(void) OP_PlayerDistortMenu[slrotatedist].status = IT_GRAYEDOUT; OP_PlayerDistortMenu[saltroll].status = IT_GRAYEDOUT; } + + if (cv_stairjank.value) + { + OP_PlayerDistortMenu[stairjanksfx].status = IT_STRING | IT_CVAR; + } + else + { + OP_PlayerDistortMenu[stairjanksfx].status = IT_GRAYEDOUT; + } } void Bird_menu_Onchange(void) diff --git a/src/p_map.c b/src/p_map.c index ef4997293..ed4698f1b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2594,10 +2594,14 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) { /* use a shorter sound if not two tics have passed * since the last step */ - //S_ReducedVFXSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268), NULL); - //S_StartSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268)); + //S_ReducedVFXSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268), NULL); + //S_StartSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268)); // sound does not work out all that well for kart maps + // best i can do... + if (cv_stairjanksfx.value) + S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul + // TODO: maybe spawn smol dust effect similar to RR? /*if (!thing->player->stairjank) { diff --git a/src/r_main.cpp b/src/r_main.cpp index c4719e2e5..038fa8a6a 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1601,6 +1601,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_sloperolldist); CV_RegisterVar(&cv_sparkroll); CV_RegisterVar(&cv_stairjank); + CV_RegisterVar(&cv_stairjanksfx); CV_RegisterVar(&cv_showhud); CV_RegisterVar(&cv_translucenthud); From 2413a3503c6436b9233a47e0d10157f401ea534a Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 29 Jun 2026 20:44:30 +0300 Subject: [PATCH 29/30] Add stairjank particle effect using drift dust --- src/p_map.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index ed4698f1b..3206b5c81 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2603,15 +2603,33 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul // TODO: maybe spawn smol dust effect similar to RR? - /*if (!thing->player->stairjank) + //if (!thing->player->stairjank) { - mobj_t * spark = P_SpawnMobjFromMobj(thing, 0, 0, 0, MT_JANKSPARK); - spark->fuse = 9; - spark->cusval = K_StairJankFlip(ANGLE_90); + // 90 degrees to direction you're facing + fixed_t dirx = -FINESINE(thing->angle>>ANGLETOFINESHIFT); + fixed_t diry = FINECOSINE(thing->angle>>ANGLETOFINESHIFT); + fixed_t offset = thing->radius; + + if (leveltime % 8 < 4) + { + dirx = -dirx; + diry = -diry; + } + + mobj_t * spark = P_SpawnMobj(thing->x + FixedMul(dirx, offset), thing->y + FixedMul(diry, offset), thing->z, MT_DRIFTDUST); + spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momx)/10; + spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momy)/10; + spark->momz = 5*FRACUNIT; + spark->scale = mapobjectscale/5; + spark->destscale = mapobjectscale/2; + spark->islocal = true; + //spark->fuse = 9; + spark->color = SKINCOLOR_WHITE; + //spark->cusval = K_StairJankFlip(ANGLE_90); P_SetTarget(&spark->target, thing); - P_SetTarget(&spark->owner, thing); - spark->renderflags |= RF_REDUCEVFX; - }*/ + //P_SetTarget(&spark->owner, thing); + //spark->renderflags |= RF_REDUCEVFX; + } thing->player->stairjank = 9; //thing->player->stairjank = 17; From ec0615043278f1c8c883c7c159393714a83b1253 Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 29 Jun 2026 20:45:45 +0300 Subject: [PATCH 30/30] This todo is done :3 --- src/p_map.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 3206b5c81..5b78d9a3d 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2602,7 +2602,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) if (cv_stairjanksfx.value) S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul - // TODO: maybe spawn smol dust effect similar to RR? //if (!thing->player->stairjank) { // 90 degrees to direction you're facing