From 252cd5cde533b870122cadf618056920cef6a427 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 1 Dec 2024 22:06:23 +0100 Subject: [PATCH] better fix for netgame join hoop crash this actually works and makes em animate apparently somehow on netjoin some hprev entries get mangled but are not null? no clue why that happens since hoops arent even netsynched only their "spawnpoint" is --- src/g_game.c | 2 +- src/p_inter.c | 5 ++--- src/p_mobj.c | 11 +---------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 711f7eb1a..8c28a58a0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2029,7 +2029,7 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) UINT8 splits; UINT8 viewd; - INT32 *displayplayerp; + INT32 *displayplayerp; INT32 olddisplayplayer; INT32 playersviewable; diff --git a/src/p_inter.c b/src/p_inter.c index 29d7e4739..378cec557 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -976,11 +976,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 f4515da9a..c1b8b4a6f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11778,12 +11778,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; @@ -11829,10 +11825,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; @@ -11969,9 +11963,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;