- 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 int DoActorBeginSlide(DSWActor* actor, short ang, short vel, short dec)
DoActorBeginSlide(int SpriteNum, short ang, short vel, short dec)
{ {
USERp u = User[SpriteNum].Data(); USERp u = actor->u();
SET(u->Flags, SPR_SLIDING); 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); int32_t const vel = FindDistance2D(pp->xvect>>8, pp->yvect>>8);
if (vel < 9000) 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)) if (DoActorSlide(actor))
continue; continue;
} }

View file

@ -5503,7 +5503,8 @@ ActorStdMissile(short SpriteNum, short Weapon)
int int
ActorDamageSlide(int SpriteNum, int damage, int ang) 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; int slide_vel,slide_dec;
if (TEST(u->Flags, SPR_CLIMBING)) if (TEST(u->Flags, SPR_CLIMBING))
@ -5516,12 +5517,12 @@ ActorDamageSlide(int SpriteNum, int damage, int ang)
if (damage <= 10) if (damage <= 10)
{ {
DoActorBeginSlide(SpriteNum, ang, 64, 5); DoActorBeginSlide(actor, ang, 64, 5);
return true; return true;
} }
else if (damage <= 20) else if (damage <= 20)
{ {
DoActorBeginSlide(SpriteNum, ang, 128, 5); DoActorBeginSlide(actor, ang, 128, 5);
return true; return true;
} }
else else
@ -5534,7 +5535,7 @@ ActorDamageSlide(int SpriteNum, int damage, int ang)
if (slide_vel < -1000) slide_vel = -1000; if (slide_vel < -1000) slide_vel = -1000;
slide_dec = 5; slide_dec = 5;
DoActorBeginSlide(SpriteNum, ang, slide_vel, slide_dec); DoActorBeginSlide(actor, ang, slide_vel, slide_dec);
return true; return true;
} }

View file

@ -156,7 +156,7 @@ extern short target_ang;
bool SpriteOverlap(short, short); 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 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); int GetOverlapSector(int x, int y, short *over, short *under);
bool MissileHitDiveArea(short SpriteNum); bool MissileHitDiveArea(short SpriteNum);