Rename variables for Fang waypoints, in preparation for new global waypoint data structure

This commit is contained in:
MascaraSnake 2020-05-12 14:53:10 +02:00
parent 20d207a7b7
commit 435e6c9812

View file

@ -8794,19 +8794,19 @@ void A_Dye(mobj_t *actor)
#endif #endif
if (color >= MAXTRANSLATIONS) if (color >= MAXTRANSLATIONS)
return; return;
if (!color) if (!color)
target->colorized = false; target->colorized = false;
else else
target->colorized = true; target->colorized = true;
// What if it's a player? // What if it's a player?
if (target->player) if (target->player)
{ {
target->player->powers[pw_dye] = color; target->player->powers[pw_dye] = color;
return; return;
} }
target->color = color; target->color = color;
} }
@ -12642,8 +12642,8 @@ void A_Boss5FindWaypoint(mobj_t *actor)
else // locvar1 == 0 else // locvar1 == 0
{ {
fixed_t hackoffset = P_MobjFlip(actor)*56*FRACUNIT; fixed_t hackoffset = P_MobjFlip(actor)*56*FRACUNIT;
INT32 numwaypoints = 0; INT32 numfangwaypoints = 0;
mobj_t **waypoints; mobj_t **fangwaypoints;
INT32 key; INT32 key;
actor->z += hackoffset; actor->z += hackoffset;
@ -12668,7 +12668,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue; continue;
if (!P_CheckSight(actor, mapthings[i].mobj)) if (!P_CheckSight(actor, mapthings[i].mobj))
continue; continue;
numwaypoints++; numfangwaypoints++;
} }
// players also count as waypoints apparently // players also count as waypoints apparently
@ -12690,11 +12690,11 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue; continue;
if (!P_CheckSight(actor, players[i].mo)) if (!P_CheckSight(actor, players[i].mo))
continue; continue;
numwaypoints++; numfangwaypoints++;
} }
} }
if (!numwaypoints) if (!numfangwaypoints)
{ {
// restore z position // restore z position
actor->z -= hackoffset; actor->z -= hackoffset;
@ -12702,8 +12702,8 @@ void A_Boss5FindWaypoint(mobj_t *actor)
} }
// allocate the table and reset count to zero // allocate the table and reset count to zero
waypoints = Z_Calloc(sizeof(*waypoints)*numwaypoints, PU_STATIC, NULL); fangwaypoints = Z_Calloc(sizeof(*waypoints)*numfangwaypoints, PU_STATIC, NULL);
numwaypoints = 0; numfangwaypoints = 0;
// now find them again and add them to the table! // now find them again and add them to the table!
for (i = 0; i < nummapthings; i++) for (i = 0; i < nummapthings; i++)
@ -12728,7 +12728,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
} }
if (!P_CheckSight(actor, mapthings[i].mobj)) if (!P_CheckSight(actor, mapthings[i].mobj))
continue; continue;
waypoints[numwaypoints++] = mapthings[i].mobj; fangwaypoints[numfangwaypoints++] = mapthings[i].mobj;
} }
if (actor->extravalue2 > 1) if (actor->extravalue2 > 1)
@ -12749,25 +12749,25 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue; continue;
if (!P_CheckSight(actor, players[i].mo)) if (!P_CheckSight(actor, players[i].mo))
continue; continue;
waypoints[numwaypoints++] = players[i].mo; fangwaypoints[numfangwaypoints++] = players[i].mo;
} }
} }
// restore z position // restore z position
actor->z -= hackoffset; actor->z -= hackoffset;
if (!numwaypoints) if (!numfangwaypoints)
{ {
Z_Free(waypoints); // free table Z_Free(fangwaypoints); // free table
goto nowaypoints; // ??? goto nowaypoints; // ???
} }
key = P_RandomKey(numwaypoints); key = P_RandomKey(numfangwaypoints);
P_SetTarget(&actor->tracer, waypoints[key]); P_SetTarget(&actor->tracer, fangwaypoints[key]);
if (actor->tracer->type == MT_FANGWAYPOINT) if (actor->tracer->type == MT_FANGWAYPOINT)
actor->tracer->reactiontime = numwaypoints/4; // Monster Iestyn: is this how it should be? I count center waypoints as waypoints unlike the original Lua script actor->tracer->reactiontime = numfangwaypoints/4; // Monster Iestyn: is this how it should be? I count center waypoints as waypoints unlike the original Lua script
Z_Free(waypoints); // free table Z_Free(fangwaypoints); // free table
} }
// now face the tracer you just set! // now face the tracer you just set!