Fix P_GetMobjByTag so that it iterates through mapthings

This commit is contained in:
Lactozilla 2023-08-25 05:02:23 -03:00
parent 3505c90d5c
commit 5996c8a5ac
2 changed files with 7 additions and 11 deletions

View file

@ -6295,17 +6295,12 @@ boolean P_CompareSectorPortals(sectorportal_t *a, sectorportal_t *b)
static mobj_t *P_GetMobjByTag(INT32 tag) static mobj_t *P_GetMobjByTag(INT32 tag)
{ {
for (thinker_t *th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) INT32 mtnum = -1;
TAG_ITER_THINGS(tag, mtnum)
{ {
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) mobj_t *mo = mapthings[mtnum].mobj;
continue; if (mo)
mobj_t *mo = (mobj_t *)th;
if (mo->spawnpoint == NULL)
continue;
if (Tag_Find(&mo->spawnpoint->tags, tag))
return mo; return mo;
} }

View file

@ -329,7 +329,8 @@ static boolean Portal_AddSkybox (const visplane_t* plane)
static void Portal_GetViewpointForSecPortal(portal_t *portal, sectorportal_t *secportal) static void Portal_GetViewpointForSecPortal(portal_t *portal, sectorportal_t *secportal)
{ {
fixed_t x, y, z, angle; fixed_t x, y, z;
angle_t angle;
switch (secportal->type) switch (secportal->type)
{ {