Merge branch 'next'

This commit is contained in:
RedEnchilada 2016-01-03 10:35:12 -06:00
commit 0c6aaf87d5
2 changed files with 24 additions and 37 deletions

View file

@ -7597,48 +7597,35 @@ void A_SetTargetsTarget(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 locvar2 = var2;
mobj_t *targetedmobj = NULL;
thinker_t *th;
mobj_t *mo2;
mobj_t *oldtarg = NULL, *newtarg = NULL;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_SetTargetsTarget", actor))
return;
#endif
if ((!locvar1 && (!actor->target)) || (locvar1 && (!actor->tracer)))
// actor's target
if (locvar1) // or tracer
oldtarg = actor->tracer;
else
oldtarg = actor->target;
if (P_MobjWasRemoved(oldtarg))
return;
if ((!locvar1 && !locvar2 && (!actor->target->target))
|| (!locvar1 && locvar2 && (!actor->target->tracer))
|| (locvar1 && !locvar2 && (!actor->tracer->target))
|| (locvar1 && locvar2 && (!actor->tracer->tracer)))
return; // Don't search for nothing.
// scan the thinkers
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if ((!locvar1 && !locvar2 && (mo2 == actor->target->target))
|| (!locvar1 && locvar2 && (mo2 == actor->target->tracer))
|| (locvar1 && !locvar2 && (mo2 == actor->tracer->target))
|| (locvar1 && locvar2 && (mo2 == actor->tracer->tracer)))
{
targetedmobj = mo2;
break;
}
}
if (!targetedmobj)
return; // Oops, nothing found..
if (!locvar1)
P_SetTarget(&actor->target, targetedmobj);
// actor's target's target!
if (locvar2) // or tracer
newtarg = oldtarg->tracer;
else
P_SetTarget(&actor->tracer, targetedmobj);
newtarg = oldtarg->target;
if (P_MobjWasRemoved(newtarg))
return;
// set actor's new target
if (locvar1) // or tracer
P_SetTarget(&actor->tracer, newtarg);
else
P_SetTarget(&actor->target, newtarg);
}
// Function: A_SetObjectFlags

View file

@ -46,14 +46,14 @@ static pslope_t *slopelist = NULL;
static UINT16 slopecount = 0;
// Calculate line normal
void P_CalculateSlopeNormal(pslope_t *slope) {
static void P_CalculateSlopeNormal(pslope_t *slope) {
slope->normal.z = FINECOSINE(slope->zangle>>ANGLETOFINESHIFT);
slope->normal.x = -FixedMul(FINESINE(slope->zangle>>ANGLETOFINESHIFT), slope->d.x);
slope->normal.y = -FixedMul(FINESINE(slope->zangle>>ANGLETOFINESHIFT), slope->d.y);
}
// With a vertex slope that has its vertices set, configure relevant slope info
void P_ReconfigureVertexSlope(pslope_t *slope)
static void P_ReconfigureVertexSlope(pslope_t *slope)
{
vector3_t vec1, vec2;
@ -543,7 +543,7 @@ void P_SpawnSlope_Line(int linenum)
//
// Creates a new slope from three vertices with the specified IDs
//
pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flags)
static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flags)
{
size_t i;
mapthing_t *mt = mapthings;