From b97f3cdcce139b2237ad22b22e789a40dd640200 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 9 May 2020 02:17:35 -0400 Subject: [PATCH] Horizontal springs offset the sprite --- src/p_mobj.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index aa04ccac9..54fcf0e08 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12942,16 +12942,30 @@ ML_NOCLIMB : Direction not controllable mobj->angle = FixedAngle(mthing->angle*FRACUNIT); + if ((mobj->flags & MF_SPRING) + && mobj->info->damage != 0 + && mobj->info->mass == 0) + { + // Offset sprite of horizontal springs + angle_t a = mobj->angle + ANGLE_180; + mobj->sprxoff = FixedMul(mobj->radius, FINECOSINE(a >> ANGLETOFINESHIFT)); + mobj->spryoff = FixedMul(mobj->radius, FINESINE(a >> ANGLETOFINESHIFT)); + } + if ((mthing->options & MTF_AMBUSH) && (mthing->options & MTF_OBJECTSPECIAL) && (mobj->flags & MF_PUSHABLE)) + { mobj->flags2 |= MF2_CLASSICPUSH; + } else { if (mthing->options & MTF_AMBUSH) { - if (mobj->flags & MF_SPRING && mobj->info->damage) + if ((mobj->flags & MF_SPRING) && mobj->info->damage) + { mobj->angle += ANGLE_22h; + } if (mobj->flags & MF_NIGHTSITEM) {