Fix bugs (uninitialised memory the compiler didn't pick up, and not setting scale) I sleepily caused last night.
This commit is contained in:
parent
cb86ed7721
commit
364984ac12
|
@ -1266,30 +1266,32 @@ void A_FaceStabHurl(mobj_t *actor)
|
||||||
#define NUMSTEPS 3
|
#define NUMSTEPS 3
|
||||||
#define NUMGRADS 5
|
#define NUMGRADS 5
|
||||||
#define MAXVAL (NUMSTEPS*NUMGRADS)
|
#define MAXVAL (NUMSTEPS*NUMGRADS)
|
||||||
SINT8 step = ++actor->extravalue1;
|
SINT8 step = (++actor->extravalue1);
|
||||||
fixed_t basesize = FRACUNIT/MAXVAL;
|
fixed_t basesize = FRACUNIT/MAXVAL;
|
||||||
mobj_t *hwork = actor;
|
mobj_t *hwork = actor;
|
||||||
INT32 dist = 113;
|
INT32 dist = 113;
|
||||||
fixed_t xo = P_ReturnThrustX(actor, actor->angle, dist*basesize);
|
fixed_t xo = P_ReturnThrustX(actor, actor->angle, dist*basesize);
|
||||||
fixed_t yo = P_ReturnThrustY(actor, actor->angle, dist*basesize);
|
fixed_t yo = P_ReturnThrustY(actor, actor->angle, dist*basesize);
|
||||||
|
|
||||||
while (step > 0)
|
while (step > 0)
|
||||||
{
|
{
|
||||||
if (!hwork->hnext)
|
if (!hwork->hnext)
|
||||||
P_SetTarget(&hwork->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_FACESTABBERSPEAR));
|
P_SetTarget(&hwork->hnext, P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_FACESTABBERSPEAR));
|
||||||
hwork = hwork->hnext;
|
hwork = hwork->hnext;
|
||||||
hwork->angle = actor->angle + ANGLE_90;
|
hwork->angle = actor->angle + ANGLE_90;
|
||||||
hwork->destscale = FixedSqrt(basesize*step);
|
hwork->destscale = FixedSqrt(step*basesize);
|
||||||
|
P_SetScale(hwork, hwork->destscale);
|
||||||
hwork->fuse = 2;
|
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<<FRACBITS)));
|
P_TeleportMove(hwork, actor->x + xo*(15-step), actor->y + yo*(15-step), actor->z + (actor->height - hwork->height)/2 + (P_MobjFlip(actor)*(8<<FRACBITS)));
|
||||||
step -= NUMGRADS;
|
step -= NUMGRADS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((step % 5) == 0)
|
|
||||||
P_SharpDust(actor, MT_SPINDUST, actor->angle);
|
|
||||||
|
|
||||||
if (actor->extravalue1 >= MAXVAL)
|
if (actor->extravalue1 >= MAXVAL)
|
||||||
actor->extravalue1 -= NUMGRADS;
|
actor->extravalue1 -= NUMGRADS;
|
||||||
|
|
||||||
|
if ((step % 5) == 0)
|
||||||
|
P_SharpDust(actor, MT_SPINDUST, actor->angle);
|
||||||
|
|
||||||
P_FaceStabFlume(actor);
|
P_FaceStabFlume(actor);
|
||||||
return;
|
return;
|
||||||
#undef MAXVAL
|
#undef MAXVAL
|
||||||
|
|
|
@ -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;
|
fixed_t mlength, mmaxlength, mlengthset, mspeed, mphase, myaw, mpitch, mminlength, mnumspokes, mpinch, mroll, mnumnospokes, mwidth, mwidthset, mmin, msound, radiusfactor, widthfactor;
|
||||||
angle_t mspokeangle;
|
angle_t mspokeangle;
|
||||||
mobjtype_t chainlink, macetype, firsttype, linktype;
|
mobjtype_t chainlink, macetype, firsttype, linktype;
|
||||||
boolean mdosound, mdocenter, mchainlike;
|
boolean mdosound, mdocenter, mchainlike = false;
|
||||||
mobj_t *spawnee = NULL, *hprev = mobj;
|
mobj_t *spawnee = NULL, *hprev = mobj;
|
||||||
mobjflag_t mflagsapply;
|
mobjflag_t mflagsapply;
|
||||||
mobjflag2_t mflags2apply;
|
mobjflag2_t mflags2apply;
|
||||||
|
|
Loading…
Reference in New Issue