From 577c6f194f138ad4a71505945661e47e306ea4a5 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 1 Dec 2024 22:04:32 +0100 Subject: [PATCH] better fix for netgame join hoop crash this actually works and makes em animate also this IS SAFER since before the hoop stuff got really badly mangled --- src/g_game.c | 3 ++- src/p_inter.c | 5 ++--- src/p_mobj.c | 11 +---------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index ffcb7d9dd..cb13e5ce0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1692,6 +1692,7 @@ static void G_FixCamera(UINT8 view) localangle[view - 1] = (angle_t)(player->cmd.angleturn << 16); P_ResetCamera(player, &camera[view - 1]); + // Make sure the viewport doesn't interpolate at all into // its new position -- just snap instantly into place. R_ResetViewInterpolation(view); @@ -1710,7 +1711,7 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) INT32 playernumd; - INT32 *displayplayerp; + INT32 *displayplayerp; INT32 olddisplayplayer; INT32 playersviewable; diff --git a/src/p_inter.c b/src/p_inter.c index 99da37224..6fb8b7c67 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -965,11 +965,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) break; case MT_HOOPCOLLIDE: // This produces a kind of 'domino effect' with the hoop's pieces. - if (!midgamejoin) - for (; special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop + for (; !P_MobjWasRemoved(special->hprev); special = special->hprev); // Move to the first sprite in the hoop i = 0; - for (; special->type == MT_HOOP; special = special->hnext) + for (; !P_MobjWasRemoved(special->hnext) && special->type == MT_HOOP; special = special->hnext) { special->fuse = 11; special->movedir = i; diff --git a/src/p_mobj.c b/src/p_mobj.c index 0c5e3e9e7..5edabcd06 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11774,12 +11774,8 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) z = mthing->options << FRACBITS; hoopcenter = P_SpawnMobj(x, y, z, MT_HOOPCENTER); - hoopcenter->spawnpoint = mthing; - // Screw these damn hoops, I need this thinker. - //hoopcenter->flags |= MF_NOTHINK; - z += sec->f_slope ? P_GetZAt(sec->f_slope, x, y) : sec->floorheight; @@ -11825,10 +11821,8 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) mobj = P_SpawnMobj(finalx, finaly, finalz, MT_HOOP); - //if (maptol & TOL_XMAS) - //P_SetMobjState(mobj, mobj->info->seestate + (i & 1)); - mobj->z -= mobj->height/2; + P_SetTarget(&mobj->target, hoopcenter); // Link the sprite to the center. mobj->fuse = 0; @@ -11965,9 +11959,6 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) mobj = P_SpawnMobj(finalx, finaly, finalz, MT_HOOP); - //if (maptol & TOL_XMAS) - //P_SetMobjState(mobj, mobj->info->seestate + (i & 1)); - mobj->z -= mobj->height/2; P_SetTarget(&mobj->target, hoopcenter); // Link the sprite to the center. mobj->fuse = 0;