From 4241612ba2a73f10bc59bf44a0e36c11113d12bf Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Tue, 1 Jul 2025 20:14:08 -0400 Subject: [PATCH 01/11] Fix PF2_ALWAYSDAMAGED check always being true, disabling invinc/clash --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 9af619404..c8ba97f2b 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3104,7 +3104,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da invincible = false; } - if (player->pflags2 && PF2_ALWAYSDAMAGED) + if (player->pflags2 & PF2_ALWAYSDAMAGED) { invincible = false; clash = false; From 0450fe8b9e4bf157b79a60f7e7a65ce564c440f8 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Wed, 2 Jul 2025 19:29:54 -0400 Subject: [PATCH 02/11] Do fast transfer fall with C, add FX --- src/d_player.h | 4 +++- src/k_hud_track.cpp | 9 +++++++ src/k_kart.c | 57 +++++++++++++++++++++++++++++++++++++-------- src/k_kart.h | 2 ++ src/lua_playerlib.c | 4 ---- src/p_mobj.c | 49 ++++++++++++++++++++++++++++++++------ src/p_saveg.cpp | 2 -- 7 files changed, 103 insertions(+), 24 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 0dcaf03ec..d440ecbfe 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -139,9 +139,12 @@ typedef enum PF2_SELFDEAFEN = 1<<2, PF2_SERVERMUTE = 1<<3, PF2_SERVERDEAFEN = 1<<4, + PF2_STRICTFASTFALL = 1<<5, // Fastfall only with C, never with A+X. Profile preference. + PF2_ALWAYSDAMAGED = 1<<6, // Ignore invulnerability or clash conditions when evaulating damage (P_DamageMobj). Unset after use! PF2_BUBBLECONTACT = 1<<7, // ACHTUNG VERY BAD HACK - Don't allow Bubble Shield to contact certain objects unless this is a fresh blowup. + PF2_SUPERTRANSFERVFX = 1<<8, // Don't respawn the "super transfer available" VFX. } pflags2_t; typedef enum @@ -1114,7 +1117,6 @@ struct player_t fixed_t outrun; // Milky Way road effect fixed_t transfer; // Tired of Ramp Park fastfalls - boolean transfersound; uint8_t public_key[PUBKEYLENGTH]; diff --git a/src/k_hud_track.cpp b/src/k_hud_track.cpp index a99eda70f..1f8268095 100644 --- a/src/k_hud_track.cpp +++ b/src/k_hud_track.cpp @@ -461,6 +461,14 @@ std::optional object_tooltip(const mobj_t* mobj) ); case MT_PLAYER: + { + if (stplyr->fastfall == 0 && K_CanSuperTransfer(stplyr)) + return Tooltip( + TextElement( + TextElement().parse("").font(splitfont)) + ) + .offset3d(0, 0, 64 * mobj->scale * P_MobjFlip(mobj)); + return conditional( mobj->player == stplyr && stplyr->icecube.frozen, [&] { return Tooltip(TextElement( @@ -470,6 +478,7 @@ std::optional object_tooltip(const mobj_t* mobj) )).offset3d(0, 0, 64 * mobj->scale * P_MobjFlip(mobj)); } // I will be trying to figure out why the return value didn't accept a straightforward call to parse() for the rest of my life (apprx. 15 seconds) ); + } default: return {}; diff --git a/src/k_kart.c b/src/k_kart.c index dc2afcef1..1de53e917 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7635,6 +7635,13 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) } } +boolean K_CanSuperTransfer(player_t *player) +{ + if (!player->transfer) + return false; + return (abs(player->mo->momz) < (2*abs(player->transfer)/4)) || (player->mo->momz > 0) != (player->transfer > 0); +} + static void K_ThrowLandMine(player_t *player) { mobj_t *landMine; @@ -9565,16 +9572,16 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) K_TryMoveBackupItem(player); - if (onground || player->transfer < 10*player->mo->scale) + if (onground && player->transfer) { + player->fastfall = 0; player->transfer = 0; - player->transfersound = false; + player->pflags2 &= ~PF2_SUPERTRANSFERVFX; } if (player->transfer) { - boolean eligible = (abs(player->mo->momz) < (2*abs(player->transfer)/4)) || (player->mo->momz > 0) != (player->transfer > 0); - if ((player->cmd.buttons & BT_ACCELERATE) && eligible) + if (player->fastfall) { fixed_t fuckfactor = FRACUNIT; fixed_t transfergravity = 10*FRACUNIT/100; @@ -9587,11 +9594,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { fuckfactor = FRACUNIT/2; } - else if (!player->transfersound) - { - S_StartSound(player->mo, sfx_ggfall); - player->transfersound = true; - } fixed_t sx, sy; sx = P_RandomRange(PR_DECORATION, -48, 48)*FRACUNIT; @@ -9612,6 +9614,18 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { if (leveltime % 2) K_SpawnFireworkTrail(player->mo); + + if (K_CanSuperTransfer(player) && !(player->pflags2 & PF2_SUPERTRANSFERVFX)) + { + if (P_IsDisplayPlayer(player)) + S_StartSound(player->mo, sfx_gshdc); + mobj_t *gainax = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_GAINAX); + gainax->movedir = 0; + P_SetTarget(&gainax->target, player->mo); + P_SetMobjState(gainax, S_GAINAX_MID1); + gainax->flags2 |= MF2_BOSSNOTRAP; + player->pflags2 |= PF2_SUPERTRANSFERVFX; + } } } @@ -12800,6 +12814,13 @@ boolean K_PlayerEBrake(const player_t *player) return false; } + // A little gross, but when fastfalling from a transfer, we are "transferring" for 1 tic of landing. + // Prevents a single tic of ebrake friction janking everything out. + if (player->transfer && player->mo && !P_MobjWasRemoved(player->mo) && P_IsObjectOnGround(player->mo)) + { + return false; + } + if (player->fastfall != 0) { return true; @@ -13205,18 +13226,33 @@ static void K_KartSpindash(player_t *player) if (player->fastfall == 0) { + // Starting fastfall... + // ...unless this is a macro input with a strict profile. + // Then this is probably an attempted brakedrift or e-brake. if (player->pflags2 & PF2_STRICTFASTFALL) if (!(player->cmd.buttons & BT_SPINDASH)) return; // Factors 3D momentum. player->fastfallBase = FixedHypot(player->speed, player->mo->momz); + + if (K_CanSuperTransfer(player)) + { + S_StartSound(player->mo, sfx_ggfall); + } + else + { + player->transfer = 0; + } } // Update fastfall. player->fastfall = player->mo->momz; + player->spindash = 0; - P_ResetPitchRoll(player->mo); + + if (!player->transfer) + P_ResetPitchRoll(player->mo); return; } @@ -13315,6 +13351,7 @@ boolean K_FastFallBounce(player_t *player) // Handle fastfall bounce. if (player->fastfall != 0) { + CONS_Printf("ffb\n"); const fixed_t maxBounce = mapobjectscale * 10; const fixed_t minBounce = mapobjectscale; fixed_t bounce = 2 * abs(player->fastfall) / 3; diff --git a/src/k_kart.h b/src/k_kart.h index 67d4fb31a..7c644e0ad 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -352,6 +352,8 @@ fixed_t K_TeamComebackMultiplier(player_t *player); void K_ApplyStun(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype); +boolean K_CanSuperTransfer(player_t *player); + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 6cad86a53..65e2b894a 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -274,8 +274,6 @@ static int player_get(lua_State *L) lua_pushboolean(L, plr->analoginput); else if (fastcmp(field,"transfer")) lua_pushboolean(L, plr->transfer); - else if (fastcmp(field,"transfersound")) - lua_pushboolean(L, plr->transfersound); else if (fastcmp(field,"markedfordeath")) lua_pushboolean(L, plr->markedfordeath); else if (fastcmp(field,"incontrol")) @@ -933,8 +931,6 @@ static int player_set(lua_State *L) plr->analoginput = luaL_checkboolean(L, 3); else if (fastcmp(field,"transfer")) plr->transfer = luaL_checkboolean(L, 3); - else if (fastcmp(field,"transfersound")) - plr->transfersound = luaL_checkboolean(L, 3); else if (fastcmp(field,"markedfordeath")) plr->markedfordeath = luaL_checkboolean(L, 3); else if (fastcmp(field,"dotrickfx")) diff --git a/src/p_mobj.c b/src/p_mobj.c index 389ae45ed..21e0eb317 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1197,7 +1197,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo) { gravityadd *= 3; } - else if (mo->player->fastfall != 0) + else if (mo->player->fastfall != 0 && mo->player->transfer == 0) { // Fast falling @@ -1801,8 +1801,15 @@ boolean P_XYMovement(mobj_t *mo) mo->momz = transfermomz; if (mo->player) { - mo->player->transfer = transfermomz; - S_StartSound(mo, sfx_s3k98); + if (abs(transfermomz) > 10*mo->scale) + { + mo->player->transfer = transfermomz; + S_StartSound(mo, sfx_s3k98); + } + else + { + mo->player->transfer = 0; + } } mo->standingslope = NULL; @@ -8211,26 +8218,53 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->z + (mobj->target->height * P_MobjFlip(mobj))); break; case MT_GAINAX: + { + boolean vfx = !!(mobj->flags2 & MF2_BOSSNOTRAP); + if (!mobj->target || P_MobjWasRemoved(mobj->target) // sanity - || !mobj->target->player // ditto - || !mobj->target->player->glanceDir // still glancing? - || mobj->target->player->aizdriftturn // only other circumstance where can glance - || ((K_GetKartButtons(mobj->target->player) & BT_LOOKBACK) != BT_LOOKBACK)) // it's a lookback indicator... + || !mobj->target->player) // ditto { P_RemoveMobj(mobj); return false; } + if (!vfx) + { + if (!mobj->target->player->glanceDir // still glancing? + || mobj->target->player->aizdriftturn // only other circumstance where can glance + || ((K_GetKartButtons(mobj->target->player) & BT_LOOKBACK) != BT_LOOKBACK)) // it's a lookback indicator... + { + P_RemoveMobj(mobj); + return false; + } + } + + if (vfx) + { + if (P_IsObjectOnGround(mobj->target) || mobj->target->player->fastfall + || !K_CanSuperTransfer(mobj->target->player)) + { + P_RemoveMobj(mobj); + return false; + } + } + mobj->angle = mobj->target->player->drawangle; mobj->z = mobj->target->z; K_MatchGenericExtraFlags(mobj, mobj->target); + mobj->renderflags = (mobj->renderflags & ~RF_DONTDRAW)|K_GetPlayerDontDrawFlag(mobj->target->player); + if (vfx) + mobj->renderflags ^= INT32_MAX; P_MoveOrigin(mobj, mobj->target->x + FixedMul(34 * mapobjectscale, FINECOSINE((mobj->angle + mobj->movedir) >> ANGLETOFINESHIFT)), mobj->target->y + FixedMul(34 * mapobjectscale, FINESINE((mobj->angle + mobj->movedir) >> ANGLETOFINESHIFT)), mobj->z + (32 * mapobjectscale * P_MobjFlip(mobj))); + if (vfx) + break; + { statenum_t gainaxstate = mobj->state-states; if (gainaxstate == S_GAINAX_TINY) @@ -8254,6 +8288,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) } break; + } case MT_FLAMESHIELDPAPER: if (!mobj->target || P_MobjWasRemoved(mobj->target)) { diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 3f80ce27c..2351cc64b 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -696,7 +696,6 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEFIXED(save->p, players[i].outrun); WRITEFIXED(save->p, players[i].transfer); - WRITEUINT8(save->p, players[i].transfersound); WRITEUINT8(save->p, players[i].rideroid); WRITEUINT8(save->p, players[i].rdnodepull); @@ -1358,7 +1357,6 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].outrun = READFIXED(save->p); players[i].transfer = READFIXED(save->p); - players[i].transfersound = READUINT8(save->p); players[i].rideroid = (boolean)READUINT8(save->p); players[i].rdnodepull = (boolean)READUINT8(save->p); From 7378cf2cd675b26d6f9ff9cb5481246fd8630c07 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Wed, 2 Jul 2025 20:41:09 -0400 Subject: [PATCH 03/11] Comment out ffb print Comment out fast-fall bounce print --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 1de53e917..7a1526090 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -13351,7 +13351,7 @@ boolean K_FastFallBounce(player_t *player) // Handle fastfall bounce. if (player->fastfall != 0) { - CONS_Printf("ffb\n"); + //CONS_Printf("ffb\n"); const fixed_t maxBounce = mapobjectscale * 10; const fixed_t minBounce = mapobjectscale; fixed_t bounce = 2 * abs(player->fastfall) / 3; From 4ee8ec15d32d253f4758fd7d846e93abb2b80f2c Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Wed, 2 Jul 2025 21:07:33 -0400 Subject: [PATCH 04/11] Disallow failsafe when doing super transfer --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 7a1526090..43f26ac71 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -13476,7 +13476,7 @@ static void K_AirFailsafe(player_t *player) // Accel inputs queue air-failsafe for when they're released, // as long as they're not part of a fastfall attempt. - if ((buttons & (BT_ACCELERATE|BT_BRAKE)) == BT_ACCELERATE || K_GetForwardMove(player) != 0) + if ((buttons & (BT_ACCELERATE|BT_BRAKE)) == BT_ACCELERATE || K_GetForwardMove(player) != 0 || (player->fastfall && player->transfer)) { player->pflags |= PF_AIRFAILSAFE; return; From e4ab3a036e3729774c24ec8f6fdf05da23d27cee Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Wed, 2 Jul 2025 22:49:46 -0400 Subject: [PATCH 05/11] Allow room select even with mddified files --- src/menus/play-online-room-select.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/menus/play-online-room-select.c b/src/menus/play-online-room-select.c index fa346c5e7..d9ecc6125 100644 --- a/src/menus/play-online-room-select.c +++ b/src/menus/play-online-room-select.c @@ -71,13 +71,14 @@ void M_MPRoomSelectInit(INT32 choice) if (modifiedgame) { M_StartMessage("Server Browser & Add-Ons", M_GetText("You have add-ons loaded.\nYou won't be able to join netgames!\n\nTo play online, restart the game\nand don't load any addons.\n\n\"Dr. Robotnik's Ring Racers\" will\nautomatically add everything\nyou need when you join.\n"), NULL, MM_NOTHING, NULL, NULL); - return; } // The following behaviour is affected by modifiedgame despite the above restriction. // It's a sanity check were that to be removed, wheither by us or by a modified client. // "wheither"? That typo rules, I'm keeping that ~toast 280823 + // thanks toaster - Tyron 2025-07-02 + mpmenu.room = (modifiedgame == true) ? 1 : 0; mpmenu.ticker = 0; mpmenu.servernum = 0; From dc1d34aa0b9eab14ed5c71cbd28a2b72851f92a7 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 02:17:45 -0400 Subject: [PATCH 06/11] Fix use-after-remove when bailing with attracting rings --- src/k_kart.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 43f26ac71..0aa3b9c6b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -14193,8 +14193,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // really silly stupid dumb HACK to fix interp // without needing to duplicate any code A_AttractChase(ring); - P_SetOrigin(ring, ring->x, ring->y, ring->z); - ring->extravalue1 = 1; + + // ring can be removed if the player is in a state that explicitly blocks ring pickup + // try not to go crazy for a week figuring out why bail randomly crashes :)))))) + if (ring && !P_MobjWasRemoved(ring)) + { + P_SetOrigin(ring, ring->x, ring->y, ring->z); + ring->extravalue1 = 1; + } + UINT8 dumprate = 3; From 3bc26f2e7536031ad2ea3486048b8bd2c931c100 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 03:08:18 -0400 Subject: [PATCH 07/11] Disable error messages while fuzzing --- src/sdl/i_system.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index ae2c35d5c..d766b80bf 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1769,7 +1769,8 @@ void I_Error(const char *error, ...) // Implement message box with SDL_ShowSimpleMessageBox, // which should fail gracefully if it can't put a message box up // on the target system - if (!M_CheckParm("-dedicated")) + extern consvar_t cv_fuzz; + if (!M_CheckParm("-dedicated") && !(cv_fuzz.value)) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Dr. Robotnik's Ring Racers " VERSIONSTRING " Recursive Error", buffer, NULL); @@ -1814,7 +1815,9 @@ void I_Error(const char *error, ...) I_ShutdownGraphics(); I_ShutdownInput(); - I_ShowErrorMessageBox(buffer, false); + extern consvar_t cv_fuzz; + if (!cv_fuzz.value) + I_ShowErrorMessageBox(buffer, false); // We wait until now to do this so the funny sound can be heard I_ShutdownSound(); From 1d6ade51ae0901d0e4d12e0c3df075187bc58f3d Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 02:17:45 -0400 Subject: [PATCH 08/11] Fix use-after-remove when bailing with attracting rings --- src/k_kart.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 43f26ac71..0aa3b9c6b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -14193,8 +14193,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // really silly stupid dumb HACK to fix interp // without needing to duplicate any code A_AttractChase(ring); - P_SetOrigin(ring, ring->x, ring->y, ring->z); - ring->extravalue1 = 1; + + // ring can be removed if the player is in a state that explicitly blocks ring pickup + // try not to go crazy for a week figuring out why bail randomly crashes :)))))) + if (ring && !P_MobjWasRemoved(ring)) + { + P_SetOrigin(ring, ring->x, ring->y, ring->z); + ring->extravalue1 = 1; + } + UINT8 dumprate = 3; From 4e86c6be9d6a45c784460ba9f640748ea4ffb24d Mon Sep 17 00:00:00 2001 From: eebrozgi Date: Thu, 3 Jul 2025 15:42:07 +0300 Subject: [PATCH 09/11] no HOLD! bubble on fast transfer fall BONUS: remove unused variable that the compiler complained about --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 43f26ac71..b3cc9c666 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -12782,7 +12782,6 @@ static INT32 K_FlameShieldMax(player_t *player) UINT32 distv = 1024; // Pre no-scams: 2048 distv = distv * 16 / FLAMESHIELD_MAX; // Old distv was based on a 16-segment bar UINT32 scamradius = 1500*4; // How close is close enough that we shouldn't be allowed to scam 1st? - UINT8 i; disttofinish = K_GetItemRouletteDistance(player, 8); @@ -12912,7 +12911,8 @@ void K_KartEbrakeVisuals(player_t *p) mobj_t *spdl; fixed_t sx, sy; - if (K_PlayerEBrake(p) == true) + // Don't show the bubble visual if you're fast transfer falling + if (K_PlayerEBrake(p) == true && !p->transfer) { if (p->ebrakefor % 20 == 0) { From 249d97dbec14a40428ee391a3c18407754307a6e Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 11:21:22 -0400 Subject: [PATCH 10/11] Fuzz fixups --- src/d_clisrv.c | 2 +- src/k_kart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index d59435aa3..4581f164c 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5395,7 +5395,7 @@ static void FuzzTiccmd(ticcmd_t* target) target->forwardmove = P_RandomRange(PR_FUZZ, -MAXPLMOVE, MAXPLMOVE); target->turning = P_RandomRange(PR_FUZZ, -KART_FULLTURN, KART_FULLTURN); target->throwdir = P_RandomRange(PR_FUZZ, -KART_FULLTURN, KART_FULLTURN); - target->buttons = P_RandomRange(PR_FUZZ, 0, 255); + target->buttons = P_RandomRange(PR_FUZZ, 0, 65535); // Make fuzzed players more likely to do impactful things if (P_RandomRange(PR_FUZZ, 0, 500)) diff --git a/src/k_kart.c b/src/k_kart.c index 0aa3b9c6b..c605596de 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10599,7 +10599,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) } extern consvar_t cv_fuzz; - if (cv_fuzz.value && P_CanPickupItem(player, PICKUP_ITEMBOX)) + if (cv_fuzz.value && player->itemamount == 0 && !player->itemRoulette.active) { K_StartItemRoulette(player, P_RandomRange(PR_FUZZ, 0, 1)); } From 64c6998807e079fcd131c8fda6e535544c62f5e1 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Thu, 3 Jul 2025 13:21:45 -0400 Subject: [PATCH 11/11] Always omit unimportant files from fileneeded (fixes rejoining modded always failing in DEVELOP) --- src/d_netfil.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 3deaeeab7..6bfcf2891 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -166,7 +166,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile) for (; i < numwadfiles; i++) //mainwads+1, otherwise we start on the first mainwad { // If it has only music/sound lumps, don't put it in the list - if (i > mainwads && !wadfiles[i]->important) + if (!wadfiles[i]->important) continue; if (firstfile) @@ -175,6 +175,8 @@ UINT8 *PutFileNeeded(UINT16 firstfile) continue; } + // CONS_Printf("putting %d (%s) - mw %d\n", i, wadfiles[i]->filename, mainwads); + nameonly(strcpy(wadfilename, wadfiles[i]->filename)); // Look below at the WRITE macros to understand what these numbers mean. @@ -564,6 +566,9 @@ INT32 CL_CheckFiles(void) #endif for (i = 0; i < fileneedednum || j < numwadfiles;) { + // CONS_Printf("checking %d of %d / %d of %d?\n", i, fileneedednum, j, numwadfiles); + // CONS_Printf("i: %s / j: %s \n", fileneeded[i].filename, wadfiles[j]->filename); + if (j < numwadfiles && !wadfiles[j]->important) { // Unimportant on our side. @@ -574,11 +579,17 @@ INT32 CL_CheckFiles(void) // If this test is true, we've reached the end of one file list // and the other still has a file that's important if (i >= fileneedednum || j >= numwadfiles) + { return 2; + } + // For the sake of speed, only bother with a md5 check if (memcmp(wadfiles[j]->md5sum, fileneeded[i].md5sum, 16)) + { return 2; + } + // It's accounted for! let's keep going. CONS_Debug(DBG_NETPLAY, "'%s' accounted for\n", fileneeded[i].filename);