- skel.cpp

This commit is contained in:
Christoph Oelckers 2021-11-02 21:48:11 +01:00
parent 07f61e061e
commit a728555ec7
2 changed files with 10 additions and 19 deletions

View file

@ -500,22 +500,20 @@ ACTOR_ACTION_SET SkelActionSet =
nullptr
};
int
SetupSkel(short SpriteNum)
int SetupSkel(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,SKEL_RUN_R0,s_SkelRun[0]);
u = SpawnUser(actor,SKEL_RUN_R0,s_SkelRun[0]);
u->Health = HEALTH_SKEL_PRIEST;
}
@ -537,8 +535,7 @@ SetupSkel(short SpriteNum)
int DoSkelInitTeleport(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
SPRITEp sp = &actor->s();
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -550,8 +547,7 @@ int DoSkelInitTeleport(DSWActor* actor)
int DoSkelTeleport(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
SPRITEp sp = &actor->s();
int x,y;
x = sp->x;
@ -572,8 +568,7 @@ int DoSkelTeleport(DSWActor* actor)
else
sp->y -= 512 + RANDOM_P2(1024);
setspritez(SpriteNum, &sp->pos);
//updatesector(sp->x, sp->y, &sp->sectnum);
SetActorZ(actor, &sp->pos);
if (sp->sectnum != -1)
break;
@ -585,8 +580,7 @@ int DoSkelTeleport(DSWActor* actor)
int DoSkelTermTeleport(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
SPRITEp sp = &sprite[SpriteNum];
SPRITEp sp = &actor->s();
SET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -596,7 +590,6 @@ int DoSkelTermTeleport(DSWActor* actor)
int NullSkel(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(actor);
@ -609,7 +602,6 @@ int NullSkel(DSWActor* actor)
int DoSkelPain(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
NullSkel(actor);
@ -622,7 +614,6 @@ int DoSkelPain(DSWActor* actor)
int DoSkelMove(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
if (TEST(u->Flags,SPR_SLIDING))
DoActorSlide(actor);

View file

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