From 9561c4098e51bc5b17b8e9b0fcc32071b6c3285b Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 28 Jun 2025 01:47:43 +0200 Subject: [PATCH] remove this --- src/p_maputl.c | 41 ++++++++++++++++++----------------------- src/p_maputl.h | 2 -- src/p_mobj.c | 7 ------- 3 files changed, 18 insertions(+), 32 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index cf7bec6c9..07bd6e903 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -740,7 +740,23 @@ void P_UnsetThingPosition(mobj_t *thing) thing->touching_sectorlist = NULL; //to be restored by P_SetThingPosition } - P_UnlinkfromBlockMap(thing); + if (!(thing->flags & MF_NOBLOCKMAP)) + { + /* inert things don't need to be in blockmap + * + * killough 8/11/98: simpler scheme using pointers-to-pointers for prev + * pointers, allows head node pointers to be treated like everything else + * + * Also more robust, since it doesn't depend on current position for + * unlinking. Old method required computing head node based on position + * at time of unlinking, assuming it was the same position as during + * linking. + */ + + mobj_t *bnext, **bprev = thing->bprev; + if (bprev && (*bprev = bnext = thing->bnext) != NULL) // unlink from block map + bnext->bprev = bprev; + } } void P_UnsetPrecipThingPosition(precipmobj_t *thing) @@ -752,7 +768,7 @@ void P_UnsetPrecipThingPosition(precipmobj_t *thing) bnext->bprev = bprev; } -void P_LinkToBlockMap(mobj_t *thing, mobj_t **bmap) +static void P_LinkToBlockMap(mobj_t *thing, mobj_t **bmap) { const INT32 blockx = (unsigned)(thing->x - bmaporgx) >> MAPBLOCKSHIFT; const INT32 blocky = (unsigned)(thing->y - bmaporgy) >> MAPBLOCKSHIFT; @@ -781,27 +797,6 @@ void P_LinkToBlockMap(mobj_t *thing, mobj_t **bmap) } } -void P_UnlinkfromBlockMap(mobj_t *thing) -{ - if (!(thing->flags & MF_NOBLOCKMAP)) - { - /* inert things don't need to be in blockmap - * - * killough 8/11/98: simpler scheme using pointers-to-pointers for prev - * pointers, allows head node pointers to be treated like everything else - * - * Also more robust, since it doesn't depend on current position for - * unlinking. Old method required computing head node based on position - * at time of unlinking, assuming it was the same position as during - * linking. - */ - - mobj_t *bnext, **bprev = thing->bprev; - if (bprev && (*bprev = bnext = thing->bnext) != NULL) // unlink from block map - bnext->bprev = bprev; - } -} - // // P_SetThingPosition // Links a thing into both a block and a subsector diff --git a/src/p_maputl.h b/src/p_maputl.h index a97fab1fa..d2337d007 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -51,8 +51,6 @@ fixed_t P_InterceptVector(divline_t *v2, divline_t *v1); INT32 P_BoxOnLineSide(fixed_t *tmbox, const line_t *ld); void P_UnsetPrecipThingPosition(precipmobj_t *thing); void P_SetPrecipitationThingPosition(precipmobj_t *thing); -void P_LinkToBlockMap(mobj_t *thing, mobj_t **bmap); -void P_UnlinkfromBlockMap(mobj_t *thing); void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y); boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y); diff --git a/src/p_mobj.c b/src/p_mobj.c index 4a9641156..7538a96eb 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5643,8 +5643,6 @@ void P_SetScale(mobj_t *mobj, fixed_t newscale) oldscale = mobj->scale; //keep for adjusting stuff below - P_UnlinkfromBlockMap(mobj); - mobj->scale = newscale; mobj->radius = FixedMul(mobj->info->radius, newscale); @@ -5658,11 +5656,6 @@ void P_SetScale(mobj_t *mobj, fixed_t newscale) player->viewheight = FixedMul(FixedDiv(player->viewheight, oldscale), newscale); // Nonono don't calculate viewheight elsewhere, this is the best place for it! player->dashspeed = FixedMul(FixedDiv(player->dashspeed, oldscale), newscale); // Prevents the player from having to re-charge up spindash if the player grew in size } - - if (!(mobj->flags & MF_NOBLOCKMAP)) - { - P_LinkToBlockMap(mobj, blocklinks); - } } void P_Attract(mobj_t *source, mobj_t *dest, boolean nightsgrab) // Home in on your target