This commit is contained in:
Christoph Oelckers 2021-10-29 23:38:21 +02:00
parent 2a56479e3e
commit dc6ea40911
8 changed files with 30 additions and 28 deletions

View file

@ -874,16 +874,16 @@ int DoBeginJump(DSWActor* actor)
// set up individual actor jump gravity // set up individual actor jump gravity
u->jump_grav = ACTOR_GRAVITY; u->jump_grav = ACTOR_GRAVITY;
DoJump(u->SpriteNum); DoJump(actor);
return 0; return 0;
} }
int int DoJump(DSWActor* actor)
DoJump(short SpriteNum)
{ {
USERp u = User[SpriteNum].Data(); USERp u = actor->u();
SPRITEp sp = User[SpriteNum]->SpriteP; SPRITEp sp = &actor->s();
int SpriteNum = actor->GetSpriteIndex();
int jump_adj; int jump_adj;

View file

@ -880,7 +880,7 @@ DoBunnyBeginJumpAttack(DSWActor* actor)
// if I didn't do this here they get stuck in the air sometimes // if I didn't do this here they get stuck in the air sometimes
DoActorZrange(SpriteNum); DoActorZrange(SpriteNum);
DoJump(SpriteNum); DoJump(actor);
return 0; return 0;
} }

View file

@ -81,7 +81,7 @@ void SetSlidorActive(short SpriteNum);
void DoSlidorInterp(short, INTERP_FUNC); void DoSlidorInterp(short, INTERP_FUNC);
int DoBeginJump(DSWActor* actor); int DoBeginJump(DSWActor* actor);
int DoJump(short SpriteNum); int DoJump(DSWActor* actor);
int DoBeginFall(short SpriteNum); int DoBeginFall(short SpriteNum);
int DoFall(short SpriteNum); int DoFall(short SpriteNum);
void KeepActorOnFloor(DSWActor* actor); void KeepActorOnFloor(DSWActor* actor);

View file

@ -6398,7 +6398,7 @@ void DoPlayerDeathFlip(PLAYERp pp)
DoPlayerDeathJump(pp); DoPlayerDeathJump(pp);
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2); DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2);
if (MoveSkip2 == 0) if (MoveSkip2 == 0)
DoJump(pp->PlayerSprite); DoJump(pp->Actor());
} }
if (TEST(pp->Flags,PF_FALLING)) if (TEST(pp->Flags,PF_FALLING))
@ -6435,7 +6435,7 @@ void DoPlayerDeathDrown(PLAYERp pp)
DoPlayerDeathJump(pp); DoPlayerDeathJump(pp);
DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2); DoPlayerDeathHoriz(pp, PLAYER_DEATH_HORIZ_UP_VALUE, 2);
if (MoveSkip2 == 0) if (MoveSkip2 == 0)
DoJump(pp->PlayerSprite); DoJump(pp->Actor());
} }
if (TEST(pp->Flags,PF_FALLING)) if (TEST(pp->Flags,PF_FALLING))

View file

@ -993,7 +993,7 @@ InitRipperHang(DSWActor* actor)
// set up individual actor jump gravity // set up individual actor jump gravity
u->jump_grav = 8; u->jump_grav = 8;
DoJump(SpriteNum); DoJump(actor);
return 0; return 0;
} }
@ -1063,7 +1063,7 @@ DoRipperHangJF(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
DoJump(SpriteNum); DoJump(actor);
else else
DoFall(SpriteNum); DoFall(SpriteNum);
} }
@ -1117,7 +1117,7 @@ DoRipperBeginJumpAttack(DSWActor* actor)
// if I didn't do this here they get stuck in the air sometimes // if I didn't do this here they get stuck in the air sometimes
DoActorZrange(SpriteNum); DoActorZrange(SpriteNum);
DoJump(SpriteNum); DoJump(actor);
return 0; return 0;
} }
@ -1131,7 +1131,7 @@ DoRipperMoveJump(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
DoJump(SpriteNum); DoJump(actor);
else else
DoFall(SpriteNum); DoFall(SpriteNum);
} }
@ -1253,6 +1253,7 @@ void RipperHatch(short Weapon)
for (i = 0; i < MAX_RIPPERS; i++) for (i = 0; i < MAX_RIPPERS; i++)
{ {
New = COVERinsertsprite(wp->sectnum, STAT_DEFAULT); New = COVERinsertsprite(wp->sectnum, STAT_DEFAULT);
auto actorNew = &swActors[New];
np = &sprite[New]; np = &sprite[New];
memset(np,0,sizeof(SPRITE)); memset(np,0,sizeof(SPRITE));
np->sectnum = wp->sectnum; np->sectnum = wp->sectnum;
@ -1284,7 +1285,7 @@ void RipperHatch(short Weapon)
// if I didn't do this here they get stuck in the air sometimes // if I didn't do this here they get stuck in the air sometimes
DoActorZrange(New); DoActorZrange(New);
DoJump(New); DoJump(actorNew);
} }
} }
@ -1302,7 +1303,7 @@ DoRipperMove(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
DoJump(SpriteNum); DoJump(actor);
else else
DoFall(SpriteNum); DoFall(SpriteNum);
} }

View file

@ -990,7 +990,7 @@ InitRipper2Hang(DSWActor* actor)
// set up individual actor jump gravity // set up individual actor jump gravity
u->jump_grav = 8; u->jump_grav = 8;
DoJump(SpriteNum); DoJump(actor);
return 0; return 0;
} }
@ -1068,7 +1068,7 @@ DoRipper2HangJF(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
DoJump(SpriteNum); DoJump(actor);
else else
DoFall(SpriteNum); DoFall(SpriteNum);
} }
@ -1129,7 +1129,7 @@ DoRipper2BeginJumpAttack(DSWActor* actor)
// if I didn't do this here they get stuck in the air sometimes // if I didn't do this here they get stuck in the air sometimes
DoActorZrange(SpriteNum); DoActorZrange(SpriteNum);
DoJump(SpriteNum); DoJump(actor);
return 0; return 0;
} }
@ -1143,7 +1143,7 @@ DoRipper2MoveJump(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
DoJump(SpriteNum); DoJump(actor);
else else
DoFall(SpriteNum); DoFall(SpriteNum);
} }
@ -1266,6 +1266,7 @@ void Ripper2Hatch(short Weapon)
for (i = 0; i < MAX_RIPPER2S; i++) for (i = 0; i < MAX_RIPPER2S; i++)
{ {
New = COVERinsertsprite(wp->sectnum, STAT_DEFAULT); New = COVERinsertsprite(wp->sectnum, STAT_DEFAULT);
auto actorNew = &swActors[New];
np = &sprite[New]; np = &sprite[New];
memset(np,0,sizeof(SPRITE)); memset(np,0,sizeof(SPRITE));
np->sectnum = wp->sectnum; np->sectnum = wp->sectnum;
@ -1298,7 +1299,7 @@ void Ripper2Hatch(short Weapon)
// if I didn't do this here they get stuck in the air sometimes // if I didn't do this here they get stuck in the air sometimes
DoActorZrange(New); DoActorZrange(New);
DoJump(New); DoJump(actorNew);
} }
} }
@ -1320,7 +1321,7 @@ DoRipper2Move(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING)) if (TEST(u->Flags, SPR_JUMPING | SPR_FALLING))
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
DoJump(SpriteNum); DoJump(actor);
else else
DoFall(SpriteNum); DoFall(SpriteNum);
} }

View file

@ -381,7 +381,7 @@ int DoSkullJump(DSWActor* actor)
if (TEST(u->Flags,SPR_JUMPING)) if (TEST(u->Flags,SPR_JUMPING))
{ {
DoJump(SpriteNum); DoJump(actor);
} }
else if (TEST(u->Flags,SPR_FALLING)) else if (TEST(u->Flags,SPR_FALLING))
{ {
@ -800,7 +800,7 @@ int DoBettyJump(DSWActor* actor)
if (TEST(u->Flags,SPR_JUMPING)) if (TEST(u->Flags,SPR_JUMPING))
{ {
DoJump(SpriteNum); DoJump(actor);
} }
else if (TEST(u->Flags,SPR_FALLING)) else if (TEST(u->Flags,SPR_FALLING))
{ {

View file

@ -3895,8 +3895,8 @@ DoVomit(DSWActor* actor)
sp->yrepeat = u->sy + MulScale(12, bsin(u->Counter), 14); sp->yrepeat = u->sy + MulScale(12, bsin(u->Counter), 14);
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
{ {
DoJump(SpriteNum); DoJump(actor);
DoJump(SpriteNum); DoJump(actor);
DoShrapMove(SpriteNum); DoShrapMove(SpriteNum);
} }
else if (TEST(u->Flags, SPR_FALLING)) else if (TEST(u->Flags, SPR_FALLING))
@ -4030,7 +4030,7 @@ DoShrapDamage(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
{ {
DoJump(SpriteNum); DoJump(actor);
DoShrapMove(SpriteNum); DoShrapMove(SpriteNum);
} }
else if (TEST(u->Flags, SPR_FALLING)) else if (TEST(u->Flags, SPR_FALLING))
@ -4750,7 +4750,7 @@ DoFireballFlames(DSWActor* actor)
{ {
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
{ {
DoJump(SpriteNum); DoJump(actor);
jumping = true; jumping = true;
//u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, MISSILEMOVETICS); //u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, MISSILEMOVETICS);
} }
@ -4826,7 +4826,7 @@ DoBreakFlames(DSWActor* actor)
if (TEST(u->Flags, SPR_JUMPING)) if (TEST(u->Flags, SPR_JUMPING))
{ {
DoJump(SpriteNum); DoJump(actor);
jumping = true; jumping = true;
} }
else if (TEST(u->Flags, SPR_FALLING)) else if (TEST(u->Flags, SPR_FALLING))