mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- DoFindGroundPoint
This removes the last SpriteNum occurence in actpr.cpp
This commit is contained in:
parent
06b4e8cf08
commit
64d77945f9
7 changed files with 19 additions and 23 deletions
|
@ -712,9 +712,6 @@ int DoActorJump(DSWActor* actor)
|
||||||
// reverse your speed to falling
|
// reverse your speed to falling
|
||||||
u->jump_speed = -u->jump_speed;
|
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
|
// Change sprites state to falling
|
||||||
DoActorBeginFall(actor);
|
DoActorBeginFall(actor);
|
||||||
}
|
}
|
||||||
|
@ -823,7 +820,6 @@ int DoActorStopFall(DSWActor* actor)
|
||||||
int DoActorDeathMove(DSWActor* actor)
|
int DoActorDeathMove(DSWActor* actor)
|
||||||
{
|
{
|
||||||
USER* u = actor->u();
|
USER* u = actor->u();
|
||||||
int SpriteNum = u->SpriteNum;
|
|
||||||
|
|
||||||
SPRITEp sp = &actor->s();
|
SPRITEp sp = &actor->s();
|
||||||
int nx, ny;
|
int nx, ny;
|
||||||
|
@ -843,7 +839,7 @@ int DoActorDeathMove(DSWActor* actor)
|
||||||
move_actor(actor, nx, ny, 0);
|
move_actor(actor, nx, ny, 0);
|
||||||
|
|
||||||
// only fall on top of floor sprite or sector
|
// only fall on top of floor sprite or sector
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -792,7 +792,7 @@ int DoCoolgDeath(DSWActor* actor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
u->floor_dist = 0;
|
u->floor_dist = 0;
|
||||||
DoBeginFall(actor);
|
DoBeginFall(actor);
|
||||||
}
|
}
|
||||||
|
@ -805,7 +805,7 @@ int DoCoolgDeath(DSWActor* actor)
|
||||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
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);
|
u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
|
|
||||||
// on the ground
|
// on the ground
|
||||||
if (sp->z >= u->loz)
|
if (sp->z >= u->loz)
|
||||||
|
|
|
@ -542,7 +542,7 @@ DoEelDeath(DSWActor* actor)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
u->floor_dist = 0;
|
u->floor_dist = 0;
|
||||||
DoBeginFall(actor);
|
DoBeginFall(actor);
|
||||||
}
|
}
|
||||||
|
@ -555,7 +555,7 @@ DoEelDeath(DSWActor* actor)
|
||||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
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);
|
u->ret = move_sprite(SpriteNum, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
|
|
||||||
// on the ground
|
// on the ground
|
||||||
if (sp->z >= u->loz)
|
if (sp->z >= u->loz)
|
||||||
|
|
|
@ -528,7 +528,7 @@ DoHornetDeath(DSWActor* actor)
|
||||||
u->jump_speed = 0;
|
u->jump_speed = 0;
|
||||||
u->floor_dist = 0;
|
u->floor_dist = 0;
|
||||||
DoBeginFall(actor);
|
DoBeginFall(actor);
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
u->zclip = u->loz;
|
u->zclip = u->loz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ DoSkullMove(DSWActor* actor)
|
||||||
|
|
||||||
u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, ACTORMOVETICS);
|
u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||||
|
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ DoBettyMove(DSWActor* actor)
|
||||||
|
|
||||||
u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, ACTORMOVETICS);
|
u->ret = move_missile(SpriteNum, dax, day, daz, Z(16), Z(16), CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||||
|
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3910,7 +3910,7 @@ DoVomit(DSWActor* actor)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ChangeState(actor, s_VomitSplash);
|
ChangeState(actor, s_VomitSplash);
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
MissileWaterAdjust(SpriteNum);
|
MissileWaterAdjust(SpriteNum);
|
||||||
sp->z = u->loz;
|
sp->z = u->loz;
|
||||||
u->WaitTics = 60;
|
u->WaitTics = 60;
|
||||||
|
@ -12016,11 +12016,10 @@ DoFindGround(int16_t SpriteNum)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int DoFindGroundPoint(DSWActor* actor)
|
||||||
DoFindGroundPoint(int16_t SpriteNum)
|
|
||||||
{
|
{
|
||||||
SPRITEp sp = &sprite[SpriteNum], hsp;
|
SPRITEp sp = &actor->s(), hsp;
|
||||||
USERp u = User[SpriteNum].Data();
|
USERp u = actor->u();
|
||||||
int ceilhit, florhit;
|
int ceilhit, florhit;
|
||||||
short save_cstat;
|
short save_cstat;
|
||||||
short bak_cstat;
|
short bak_cstat;
|
||||||
|
@ -12054,7 +12053,7 @@ DoFindGroundPoint(int16_t SpriteNum)
|
||||||
// recursive
|
// recursive
|
||||||
bak_cstat = hsp->cstat;
|
bak_cstat = hsp->cstat;
|
||||||
RESET(hsp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(hsp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
hsp->cstat = bak_cstat;
|
hsp->cstat = bak_cstat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12146,7 +12145,7 @@ DoNapalm(DSWActor* actor)
|
||||||
|
|
||||||
explosion = SpawnSprite(STAT_MISSILE, NAP_EXP, s_NapExp, sp->sectnum,
|
explosion = SpawnSprite(STAT_MISSILE, NAP_EXP, s_NapExp, sp->sectnum,
|
||||||
sp->x, sp->y, sp->z, sp->ang, 0);
|
sp->x, sp->y, sp->z, sp->ang, 0);
|
||||||
|
auto expActor = &swActors[explosion];
|
||||||
exp = &sprite[explosion];
|
exp = &sprite[explosion];
|
||||||
eu = User[explosion].Data();
|
eu = User[explosion].Data();
|
||||||
|
|
||||||
|
@ -12163,7 +12162,7 @@ DoNapalm(DSWActor* actor)
|
||||||
RESET(exp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
RESET(exp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||||
eu->Radius = 1500;
|
eu->Radius = 1500;
|
||||||
|
|
||||||
DoFindGroundPoint(explosion);
|
DoFindGroundPoint(expActor);
|
||||||
MissileWaterAdjust(explosion);
|
MissileWaterAdjust(explosion);
|
||||||
exp->z = eu->loz;
|
exp->z = eu->loz;
|
||||||
exp->backupz();
|
exp->backupz();
|
||||||
|
@ -16814,6 +16813,7 @@ int DoCoolgDrip(DSWActor* actor)
|
||||||
int
|
int
|
||||||
InitCoolgDrip(short SpriteNum)
|
InitCoolgDrip(short SpriteNum)
|
||||||
{
|
{
|
||||||
|
auto actor = &swActors[SpriteNum];
|
||||||
SPRITEp sp = &sprite[SpriteNum], wp;
|
SPRITEp sp = &sprite[SpriteNum], wp;
|
||||||
USERp wu;
|
USERp wu;
|
||||||
int nx, ny, nz;
|
int nx, ny, nz;
|
||||||
|
@ -16839,7 +16839,7 @@ InitCoolgDrip(short SpriteNum)
|
||||||
wu->floor_dist = Z(4);
|
wu->floor_dist = Z(4);
|
||||||
SET(wp->cstat, CSTAT_SPRITE_YCENTER);
|
SET(wp->cstat, CSTAT_SPRITE_YCENTER);
|
||||||
|
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
@ -16889,7 +16889,7 @@ GenerateDrips(DSWActor* actor)
|
||||||
if (TEST_BOOL1(sp))
|
if (TEST_BOOL1(sp))
|
||||||
wu->spal = wp->pal = PALETTE_BLUE_LIGHTING;
|
wu->spal = wp->pal = PALETTE_BLUE_LIGHTING;
|
||||||
|
|
||||||
DoFindGroundPoint(SpriteNum);
|
DoFindGroundPoint(actor);
|
||||||
}
|
}
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop);
|
||||||
int InitVulcanBoulder(DSWActor* actor);
|
int InitVulcanBoulder(DSWActor* actor);
|
||||||
int DoBladeDamage(short SpriteNum);
|
int DoBladeDamage(short SpriteNum);
|
||||||
int DoFindGround(int16_t SpriteNum);
|
int DoFindGround(int16_t SpriteNum);
|
||||||
int DoFindGroundPoint(int16_t SpriteNum);
|
int DoFindGroundPoint(DSWActor* actor);
|
||||||
void SpriteQueueDelete(short SpriteNum);
|
void SpriteQueueDelete(short SpriteNum);
|
||||||
int HelpMissileLateral(int16_t Weapon,int dist);
|
int HelpMissileLateral(int16_t Weapon,int dist);
|
||||||
int AddSpriteToSectorObject(short SpriteNum,SECTOR_OBJECTp sop);
|
int AddSpriteToSectorObject(short SpriteNum,SECTOR_OBJECTp sop);
|
||||||
|
|
Loading…
Reference in a new issue