diff --git a/src/p_polyobj.c b/src/p_polyobj.c index 00c4a051a..43a292655 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -1618,7 +1618,7 @@ void T_PolyObjWaypoint(polywaypoint_t *th) if (!po->thinker) po->thinker = &th->thinker; - target = th->target; + target = waypoints[th->sequence][th->pointnum]; if (!target) { @@ -1696,8 +1696,6 @@ void T_PolyObjWaypoint(polywaypoint_t *th) target = waypoint; th->pointnum = target->health; - // Set the mobj as your target! -- Monster Iestyn 27/12/19 - P_SetTarget(&th->target, target); // Calculate remaining speed speed -= dist; @@ -2206,9 +2204,6 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata) // Set pointnum th->pointnum = target->health; - th->target = NULL; // set to NULL first so the below doesn't go wrong - // Set the mobj as your target! -- Monster Iestyn 27/12/19 - P_SetTarget(&th->target, target); // We don't deal with the mirror crap here, we'll // handle that in the T_Thinker function. diff --git a/src/p_polyobj.h b/src/p_polyobj.h index 6b0016195..cfed15ffe 100644 --- a/src/p_polyobj.h +++ b/src/p_polyobj.h @@ -160,8 +160,6 @@ typedef struct polywaypoint_s UINT8 returnbehavior; // behavior after reaching the last waypoint UINT8 continuous; // continuously move - used with PWR_WRAP or PWR_COMEBACK UINT8 stophere; // Will stop after it reaches the next waypoint - - mobj_t *target; // next waypoint mobj } polywaypoint_t; typedef struct polyslidedoor_s diff --git a/src/p_saveg.c b/src/p_saveg.c index e4393826d..f18c14d73 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2022,7 +2022,6 @@ static void SavePolywaypointThinker(const thinker_t *th, UINT8 type) WRITEUINT8(save_p, ht->returnbehavior); WRITEUINT8(save_p, ht->continuous); WRITEUINT8(save_p, ht->stophere); - WRITEUINT32(save_p, SaveMobjnum(ht->target)); } static void SavePolyslidedoorThinker(const thinker_t *th, const UINT8 type) @@ -3163,7 +3162,6 @@ static inline thinker_t* LoadPolywaypointThinker(actionf_p1 thinker) ht->returnbehavior = READUINT8(save_p); ht->continuous = READUINT8(save_p); ht->stophere = READUINT8(save_p); - ht->target = LoadMobj(READUINT32(save_p)); return &ht->thinker; } @@ -3410,7 +3408,6 @@ static void P_NetUnArchiveThinkers(void) case tc_polywaypoint: th = LoadPolywaypointThinker((actionf_p1)T_PolyObjWaypoint); - restoreNum = true; break; case tc_polyslidedoor: @@ -3470,7 +3467,6 @@ static void P_NetUnArchiveThinkers(void) if (restoreNum) { executor_t *delay = NULL; - polywaypoint_t *polywp = NULL; UINT32 mobjnum; for (currentthinker = thlist[THINK_MAIN].next; currentthinker != &thlist[THINK_MAIN]; currentthinker = currentthinker->next) { @@ -3481,15 +3477,6 @@ static void P_NetUnArchiveThinkers(void) continue; delay->caller = P_FindNewPosition(mobjnum); } - for (currentthinker = thlist[THINK_POLYOBJ].next; currentthinker != &thlist[THINK_POLYOBJ]; currentthinker = currentthinker->next) - { - if (currentthinker->function.acp1 != (actionf_p1)T_PolyObjWaypoint) - continue; - polywp = (void *)currentthinker; - if (!(mobjnum = (UINT32)(size_t)polywp->target)) - continue; - polywp->target = P_FindNewPosition(mobjnum); - } } }