- DoFindGroundPoint

This removes the last SpriteNum occurence in actpr.cpp
This commit is contained in:
Christoph Oelckers 2021-10-31 00:01:08 +02:00
parent 06b4e8cf08
commit 64d77945f9
7 changed files with 19 additions and 23 deletions

View file

@ -712,9 +712,6 @@ int DoActorJump(DSWActor* actor)
// reverse your speed to falling
u->jump_speed = -u->jump_speed;
//DSPRINTF(ds,"Jump: sp_num %d, hi_num %d, hi_sect %d",SpriteNum, u->hi_sp - sprite, u->hi_sectp - sector);
MONO_PRINT(ds);
// Change sprites state to falling
DoActorBeginFall(actor);
}
@ -823,7 +820,6 @@ int DoActorStopFall(DSWActor* actor)
int DoActorDeathMove(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
SPRITEp sp = &actor->s();
int nx, ny;
@ -843,7 +839,7 @@ int DoActorDeathMove(DSWActor* actor)
move_actor(actor, nx, ny, 0);
// only fall on top of floor sprite or sector
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
return 0;
}

View file

@ -792,7 +792,7 @@ int DoCoolgDeath(DSWActor* actor)
}
else
{
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
u->floor_dist = 0;
DoBeginFall(actor);
}
@ -805,7 +805,7 @@ int DoCoolgDeath(DSWActor* actor)
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
// on the ground
if (sp->z >= u->loz)

View file

@ -542,7 +542,7 @@ DoEelDeath(DSWActor* actor)
}
else
{
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
u->floor_dist = 0;
DoBeginFall(actor);
}
@ -555,7 +555,7 @@ DoEelDeath(DSWActor* actor)
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
// on the ground
if (sp->z >= u->loz)

View file

@ -528,7 +528,7 @@ DoHornetDeath(DSWActor* actor)
u->jump_speed = 0;
u->floor_dist = 0;
DoBeginFall(actor);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
u->zclip = u->loz;
}

View file

@ -275,7 +275,7 @@ DoSkullMove(DSWActor* actor)
u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, ACTORMOVETICS);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
return 0;
}
@ -696,7 +696,7 @@ DoBettyMove(DSWActor* actor)
u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, ACTORMOVETICS);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
return 0;
}

View file

@ -3910,7 +3910,7 @@ DoVomit(DSWActor* actor)
else
{
ChangeState(actor, s_VomitSplash);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
MissileWaterAdjust(SpriteNum);
sp->z = u->loz;
u->WaitTics = 60;
@ -12016,11 +12016,10 @@ DoFindGround(int16_t SpriteNum)
return false;
}
int
DoFindGroundPoint(int16_t SpriteNum)
int DoFindGroundPoint(DSWActor* actor)
{
SPRITEp sp = &sprite[SpriteNum], hsp;
USERp u = User[SpriteNum].Data();
SPRITEp sp = &actor->s(), hsp;
USERp u = actor->u();
int ceilhit, florhit;
short save_cstat;
short bak_cstat;
@ -12054,7 +12053,7 @@ DoFindGroundPoint(int16_t SpriteNum)
// recursive
bak_cstat = hsp->cstat;
RESET(hsp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
hsp->cstat = bak_cstat;
}
@ -12146,7 +12145,7 @@ DoNapalm(DSWActor* actor)
explosion = SpawnSprite(STAT_MISSILE, NAP_EXP, s_NapExp, sp->sectnum,
sp->x, sp->y, sp->z, sp->ang, 0);
auto expActor = &swActors[explosion];
exp = &sprite[explosion];
eu = User[explosion].Data();
@ -12163,7 +12162,7 @@ DoNapalm(DSWActor* actor)
RESET(exp->cstat, CSTAT_SPRITE_TRANSLUCENT);
eu->Radius = 1500;
DoFindGroundPoint(explosion);
DoFindGroundPoint(expActor);
MissileWaterAdjust(explosion);
exp->z = eu->loz;
exp->backupz();
@ -16814,6 +16813,7 @@ int DoCoolgDrip(DSWActor* actor)
int
InitCoolgDrip(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum], wp;
USERp wu;
int nx, ny, nz;
@ -16839,7 +16839,7 @@ InitCoolgDrip(short SpriteNum)
wu->floor_dist = Z(4);
SET(wp->cstat, CSTAT_SPRITE_YCENTER);
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
return w;
}
@ -16889,7 +16889,7 @@ GenerateDrips(DSWActor* actor)
if (TEST_BOOL1(sp))
wu->spal = wp->pal = PALETTE_BLUE_LIGHTING;
DoFindGroundPoint(SpriteNum);
DoFindGroundPoint(actor);
}
return w;
}

View file

@ -215,7 +215,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop);
int InitVulcanBoulder(DSWActor* actor);
int DoBladeDamage(short SpriteNum);
int DoFindGround(int16_t SpriteNum);
int DoFindGroundPoint(int16_t SpriteNum);
int DoFindGroundPoint(DSWActor* actor);
void SpriteQueueDelete(short SpriteNum);
int HelpMissileLateral(int16_t Weapon,int dist);
int AddSpriteToSectorObject(short SpriteNum,SECTOR_OBJECTp sop);