From 0fe41e06ffc3ee9bd80423122dc7d23e4563bce9 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 11 Aug 2018 12:06:50 -0400 Subject: [PATCH] Remove A_OrbitNights additional input offset on current target Z, don't need it --- src/p_enemy.c | 11 +++-------- src/p_inter.c | 23 +++-------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 40adb9d4a..68d01c163 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -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; diff --git a/src/p_inter.c b/src/p_inter.c index 99b43dbfd..86c253e4c 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -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; }