- DoActorBeginSlide

This commit is contained in:
Christoph Oelckers 2021-10-29 22:39:36 +02:00
parent ad0ed0c377
commit 9e438b4042
4 changed files with 9 additions and 9 deletions

View file

@ -612,10 +612,9 @@ void KeepActorOnFloor(DSWActor* actor)
}
int
DoActorBeginSlide(int SpriteNum, short ang, short vel, short dec)
int DoActorBeginSlide(DSWActor* actor, short ang, short vel, short dec)
{
USERp u = User[SpriteNum].Data();
USERp u = actor->u();
SET(u->Flags, SPR_SLIDING);

View file

@ -2639,7 +2639,7 @@ DriveCrush(PLAYERp pp, int *x, int *y)
int32_t const vel = FindDistance2D(pp->xvect>>8, pp->yvect>>8);
if (vel < 9000)
{
DoActorBeginSlide(i, getangle(pp->xvect, pp->yvect), vel/8, 5);
DoActorBeginSlide(actor, getangle(pp->xvect, pp->yvect), vel/8, 5);
if (DoActorSlide(actor))
continue;
}

View file

@ -5503,7 +5503,8 @@ ActorStdMissile(short SpriteNum, short Weapon)
int
ActorDamageSlide(int SpriteNum, int damage, int ang)
{
USERp u = User[SpriteNum].Data();
auto actor = &swActors[SpriteNum];
USERp u = actor->u();
int slide_vel,slide_dec;
if (TEST(u->Flags, SPR_CLIMBING))
@ -5516,12 +5517,12 @@ ActorDamageSlide(int SpriteNum, int damage, int ang)
if (damage <= 10)
{
DoActorBeginSlide(SpriteNum, ang, 64, 5);
DoActorBeginSlide(actor, ang, 64, 5);
return true;
}
else if (damage <= 20)
{
DoActorBeginSlide(SpriteNum, ang, 128, 5);
DoActorBeginSlide(actor, ang, 128, 5);
return true;
}
else
@ -5534,7 +5535,7 @@ ActorDamageSlide(int SpriteNum, int damage, int ang)
if (slide_vel < -1000) slide_vel = -1000;
slide_dec = 5;
DoActorBeginSlide(SpriteNum, ang, slide_vel, slide_dec);
DoActorBeginSlide(actor, ang, slide_vel, slide_dec);
return true;
}

View file

@ -156,7 +156,7 @@ extern short target_ang;
bool SpriteOverlap(short, short);
int SpawnShotgunSparks(PLAYERp pp, short hit_sect, short hit_wall, int hit_x, int hit_y, int hit_z, short hit_ang);
int DoActorBeginSlide(int SpriteNum, short ang, short vel, short dec);
int DoActorBeginSlide(DSWActor* actor, short ang, short vel, short dec);
int GetOverlapSector(int x, int y, short *over, short *under);
bool MissileHitDiveArea(short SpriteNum);