- lava.cpp

This commit is contained in:
Christoph Oelckers 2021-11-01 14:33:26 +01:00
parent e7dcd279af
commit 69c97a88d3
2 changed files with 7 additions and 11 deletions

View file

@ -451,22 +451,20 @@ ACTOR_ACTION_SET LavaActionSet =
nullptr
};
int
SetupLava(short SpriteNum)
int SetupLava(DSWActor* actor)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
SPRITEp sp = &actor->s();
USERp u;
ANIMATOR DoActorDecide;
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum].Data();
u = actor->u();
ASSERT(u);
}
else
{
u = SpawnUser(SpriteNum,LAVA_RUN_R0,s_LavaRun[0]);
u = SpawnUser(actor, LAVA_RUN_R0, s_LavaRun[0]);
u->Health = 100;
}
@ -489,7 +487,6 @@ SetupLava(short SpriteNum)
int NullLava(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(actor);
@ -503,13 +500,12 @@ int NullLava(DSWActor* actor)
int DoLavaMove(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(actor);
if (u->track >= 0)
ActorFollowTrack(SpriteNum, ACTORMOVETICS);
ActorFollowTrack(actor->GetSpriteIndex(), ACTORMOVETICS);
else
(*u->ActorActionFunc)(actor);

View file

@ -71,7 +71,7 @@ int SetupBunny(DSWActor*);
int SetupRipper(short);
int SetupRipper2(short);
int SetupSerp(short);
int SetupLava(short);
int SetupLava(DSWActor* actor);
int SetupSkel(short);
int SetupHornet(DSWActor*);
int SetupSkull(short);
@ -1473,7 +1473,7 @@ ActorSpawn(SPRITEp sp)
}
PicAnimOff(sp->picnum);
SetupLava(SpriteNum);
SetupLava(actor);
break;
}