From 364984ac129e973d8f15b53760ddfd09a3b36412 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 24 May 2018 13:19:42 +0100 Subject: [PATCH] Fix bugs (uninitialised memory the compiler didn't pick up, and not setting scale) I sleepily caused last night. --- src/p_enemy.c | 12 +++++++----- src/p_mobj.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index b2f3ffadf..d2ef9ab9f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1266,30 +1266,32 @@ void A_FaceStabHurl(mobj_t *actor) #define NUMSTEPS 3 #define NUMGRADS 5 #define MAXVAL (NUMSTEPS*NUMGRADS) - SINT8 step = ++actor->extravalue1; + SINT8 step = (++actor->extravalue1); fixed_t basesize = FRACUNIT/MAXVAL; mobj_t *hwork = actor; INT32 dist = 113; fixed_t xo = P_ReturnThrustX(actor, actor->angle, dist*basesize); fixed_t yo = P_ReturnThrustY(actor, actor->angle, dist*basesize); + while (step > 0) { if (!hwork->hnext) P_SetTarget(&hwork->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_FACESTABBERSPEAR)); hwork = hwork->hnext; hwork->angle = actor->angle + ANGLE_90; - hwork->destscale = FixedSqrt(basesize*step); + hwork->destscale = FixedSqrt(step*basesize); + P_SetScale(hwork, hwork->destscale); hwork->fuse = 2; P_TeleportMove(hwork, actor->x + xo*(15-step), actor->y + yo*(15-step), actor->z + (actor->height - hwork->height)/2 + (P_MobjFlip(actor)*(8<angle); - if (actor->extravalue1 >= MAXVAL) actor->extravalue1 -= NUMGRADS; + if ((step % 5) == 0) + P_SharpDust(actor, MT_SPINDUST, actor->angle); + P_FaceStabFlume(actor); return; #undef MAXVAL diff --git a/src/p_mobj.c b/src/p_mobj.c index 72e87cd33..6c46fe841 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9953,7 +9953,7 @@ void P_SpawnMapThing(mapthing_t *mthing) fixed_t mlength, mmaxlength, mlengthset, mspeed, mphase, myaw, mpitch, mminlength, mnumspokes, mpinch, mroll, mnumnospokes, mwidth, mwidthset, mmin, msound, radiusfactor, widthfactor; angle_t mspokeangle; mobjtype_t chainlink, macetype, firsttype, linktype; - boolean mdosound, mdocenter, mchainlike; + boolean mdosound, mdocenter, mchainlike = false; mobj_t *spawnee = NULL, *hprev = mobj; mobjflag_t mflagsapply; mobjflag2_t mflags2apply;