mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +00:00
- ActorFollowTrack.
This commit is contained in:
parent
69c97a88d3
commit
65da74538c
18 changed files with 25 additions and 27 deletions
|
@ -1331,7 +1331,7 @@ int DoBunnyMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -884,7 +884,7 @@ int DoCoolgMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
{
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
|
|
@ -616,7 +616,7 @@ int DoCoolieMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -578,7 +578,7 @@ int DoEelMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -767,7 +767,7 @@ int DoGirlNinjaMove(DSWActor* actor)
|
|||
|
||||
// !AIC - do track or call current action function - such as DoActorMoveCloser()
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
{
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
|
|
@ -544,7 +544,7 @@ int DoGoroMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -611,7 +611,7 @@ int DoHornetMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ int DoLavaMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ int SpawnVis(short Parent, short sectnum, int x, int y, int z, int amt);
|
|||
|
||||
enum TriggerType { TRIGGER_TYPE_REMOTE_SO };
|
||||
|
||||
int ActorFollowTrack(short SpriteNum, short locktics);
|
||||
int ActorFollowTrack(DSWActor*, short locktics);
|
||||
void ActorLeaveTrack(short SpriteNum);
|
||||
void RefreshPoints(SECTOR_OBJECTp sop, int nx, int ny, bool dynamic);
|
||||
void TrackSetup(void);
|
||||
|
|
|
@ -2039,7 +2039,7 @@ DoNinjaMove(DSWActor* actor)
|
|||
|
||||
// !AIC - do track or call current action function - such as DoActorMoveCloser()
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
{
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
|
|
@ -1322,7 +1322,7 @@ DoRipperMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -1339,7 +1339,7 @@ DoRipper2Move(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -778,7 +778,7 @@ int DoSerpMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -628,7 +628,7 @@ int DoSkelMove(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -702,7 +702,7 @@ int DoSumoMove(DSWActor* actor)
|
|||
//DoActorSlide(actor);
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -3631,12 +3631,10 @@ present time.
|
|||
|
||||
*/
|
||||
|
||||
int
|
||||
ActorFollowTrack(short SpriteNum, short locktics)
|
||||
int ActorFollowTrack(DSWActor* actor, short locktics)
|
||||
{
|
||||
auto actor = &swActors[SpriteNum];
|
||||
USERp u = User[SpriteNum].Data();
|
||||
SPRITEp sp = User[SpriteNum]->SpriteP;
|
||||
USERp u = actor->u();
|
||||
SPRITEp sp = &actor->s();
|
||||
PLAYERp pp;
|
||||
|
||||
int move_actor(short SpriteNum, int xchange, int ychange, int zchange);
|
||||
|
@ -3695,11 +3693,11 @@ ActorFollowTrack(short SpriteNum, short locktics)
|
|||
|
||||
if ((dist = Distance(sp->x, sp->y, tpoint->x, tpoint->y)) < 200) // 64
|
||||
{
|
||||
if (!ActorTrackDecide(tpoint, SpriteNum))
|
||||
if (!ActorTrackDecide(tpoint, actor->GetSpriteIndex()))
|
||||
return true;
|
||||
|
||||
// get the next point
|
||||
NextActorTrackPoint(SpriteNum);
|
||||
NextActorTrackPoint(actor->GetSpriteIndex());
|
||||
tpoint = Track[u->track].TrackPoint + u->point;
|
||||
|
||||
if (!(TEST(u->Flags, SPR_CLIMBING | SPR_DONT_UPDATE_ANG)))
|
||||
|
@ -3763,7 +3761,7 @@ ActorFollowTrack(short SpriteNum, short locktics)
|
|||
|
||||
sp->ang = getangle(tpoint->x - sp->x, tpoint->y - sp->y);
|
||||
|
||||
ActorLeaveTrack(SpriteNum);
|
||||
ActorLeaveTrack(actor->GetSpriteIndex());
|
||||
RESET(sp->cstat, CSTAT_SPRITE_YCENTER);
|
||||
sp->z += u->sy;
|
||||
|
||||
|
@ -3788,13 +3786,13 @@ ActorFollowTrack(short SpriteNum, short locktics)
|
|||
nz = sp->zvel * locktics;
|
||||
}
|
||||
|
||||
SetCollision(u, move_sprite(SpriteNum, nx, ny, nz, u->ceiling_dist, u->floor_dist, 0, locktics));
|
||||
SetCollision(u, move_sprite(actor->GetSpriteIndex(), nx, ny, nz, u->ceiling_dist, u->floor_dist, 0, locktics));
|
||||
|
||||
|
||||
if (u->ret)
|
||||
{
|
||||
if (!TEST(u->Flags, SPR_JUMPING|SPR_FALLING))
|
||||
ActorLeaveTrack(SpriteNum);
|
||||
ActorLeaveTrack(actor->GetSpriteIndex());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -738,7 +738,7 @@ int DoZillaMove(DSWActor* actor)
|
|||
|
||||
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -917,7 +917,7 @@ DoZombieMove(DSWActor* actor)
|
|||
|
||||
// Do track or call current action function - such as DoActorMoveCloser()
|
||||
if (u->track >= 0)
|
||||
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
|
||||
ActorFollowTrack(actor, ACTORMOVETICS);
|
||||
else
|
||||
{
|
||||
(*u->ActorActionFunc)(actor);
|
||||
|
|
Loading…
Reference in a new issue