Remove A_OrbitNights additional input offset on current target Z, don't need it

This commit is contained in:
mazmazz 2018-08-11 12:06:50 -04:00
parent c8dcb57e83
commit 0fe41e06ff
2 changed files with 6 additions and 28 deletions

View File

@ -8544,14 +8544,12 @@ void A_ToggleFlameJet(mobj_t* actor)
// var1 = Angle adjustment (aka orbit speed)
// var2:
// Lower 16 bits: height offset
// Upper 8 bits: set if object is Nightopian Helper
// Highest 8 bits: center height offset to target by this divisor
// Upper 16 bits: set if object is Nightopian Helper
//
void A_OrbitNights(mobj_t* actor)
{
INT32 ofs = (var2 & 0xFFFF);
boolean ishelper = ((var2 >> 16) & 0xFF);
INT32 ofsdiv = var2 >> 24;
boolean ishelper = var2 >> 16;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_OrbitNights", actor))
return;
@ -8581,10 +8579,7 @@ void A_OrbitNights(mobj_t* actor)
actor->x = actor->target->x + fc;
actor->y = actor->target->y + fs;
if (ofsdiv)
actor->z = (actor->target->z + actor->target->height / ofsdiv) + fh + FixedMul(16*FRACUNIT, actor->scale);
else
actor->z = actor->target->z + fh + FixedMul(16*FRACUNIT, actor->scale);
actor->z = actor->target->z + fh + FixedMul(16*FRACUNIT, actor->scale);
// Semi-lazy hack
actor->angle = (angle_t)actor->extravalue1 + ANGLE_90;

View File

@ -799,19 +799,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
if (toucher->tracer) // Move the ideya over to the drone!
{
statenum_t currentstate = toucher->tracer->state - states;
mobj_t *hnext = special->hnext;
P_SetTarget(&special->hnext, toucher->tracer);
P_SetTarget(&special->hnext->hnext, hnext); // Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.
P_SetTarget(&special->hnext->target, special);
// switch to centered orbit states
if (currentstate >= mobjinfo[MT_GOTEMERALD].missilestate
&& currentstate <= mobjinfo[MT_GOTEMERALD].missilestate + 4)
P_SetMobjState(toucher->tracer,
mobjinfo[MT_GOTEMERALD].raisestate + currentstate - mobjinfo[MT_GOTEMERALD].missilestate);
P_SetTarget(&special->hnext->target, special->target ? special->target : special); // goalpost
P_SetTarget(&toucher->tracer, NULL);
if (hnext)
{
special->hnext->extravalue1 = (angle_t)(hnext->extravalue1 - 72*ANG1);
@ -821,19 +814,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
if (player->exiting) // ...then move it back?
{
mobj_t *hnext = special;
statenum_t currentstate;
mobj_t *hnext = special->target ? special->target : special; // goalpost
while ((hnext = hnext->hnext))
{
P_SetTarget(&hnext->target, toucher);
currentstate = hnext->state - states;
// switch to regular orbit states
if (currentstate >= mobjinfo[MT_GOTEMERALD].raisestate
&& currentstate <= mobjinfo[MT_GOTEMERALD].raisestate + 4)
P_SetMobjState(hnext,
mobjinfo[MT_GOTEMERALD].missilestate + currentstate - mobjinfo[MT_GOTEMERALD].raisestate);
}
}
return;
}