mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- eliminated a few calls to int_Actor* functions
This commit is contained in:
parent
b557e5b5db
commit
61fc57131f
4 changed files with 10 additions and 20 deletions
|
@ -331,7 +331,7 @@ int DoActorSectorDamage(DSWActor* actor)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (int_ActorZOfBottom(actor) >= sectp->int_floorz())
|
||||
else if (ActorZOfBottom(actor) >= sectp->floorz)
|
||||
{
|
||||
if ((actor->user.DamageTics -= synctics) < 0)
|
||||
{
|
||||
|
|
|
@ -98,11 +98,7 @@ bool ActorFlaming(DSWActor* actor)
|
|||
auto flame = actor->user.flameActor;
|
||||
if (flame != nullptr)
|
||||
{
|
||||
int size;
|
||||
|
||||
size = int_ActorSizeZ(actor) - (int_ActorSizeZ(actor) >> 2);
|
||||
|
||||
if (int_ActorSizeZ(flame) > size)
|
||||
if (ActorSizeZ(flame) > ActorSizeZ(actor) * 0.75)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
|
|||
actor->user.lo_step = Z(32);
|
||||
|
||||
actor->user.floor_dist = actor->user.zclip - actor->user.lo_step * zinttoworld;
|
||||
actor->user.ceiling_dist = int_ActorSizeZ(actor) * zinttoworld - actor->user.zclip;
|
||||
actor->user.ceiling_dist = ActorSizeZ(actor) - actor->user.zclip;
|
||||
|
||||
actor->user.Radius = 400;
|
||||
|
||||
|
|
|
@ -1726,8 +1726,7 @@ int InitPhosphorus(DSWActor* actor)
|
|||
|
||||
int InitBloodSpray(DSWActor* actor, bool dogib, short velocity)
|
||||
{
|
||||
int nx, ny, nz;
|
||||
short i, cnt, ang, vel, rnd;
|
||||
short cnt, vel, rnd;
|
||||
|
||||
|
||||
if (dogib)
|
||||
|
@ -1746,10 +1745,9 @@ int InitBloodSpray(DSWActor* actor, bool dogib, short velocity)
|
|||
PlaySound(DIGI_GIBS3, actor, v3df_none);
|
||||
// }
|
||||
|
||||
ang = actor->int_ang();
|
||||
vel = velocity;
|
||||
|
||||
for (i=0; i<cnt; i++)
|
||||
DAngle ang = actor->spr.angle;
|
||||
for (int i=0; i<cnt; i++)
|
||||
{
|
||||
|
||||
if (velocity == -1)
|
||||
|
@ -1758,17 +1756,13 @@ int InitBloodSpray(DSWActor* actor, bool dogib, short velocity)
|
|||
vel = 105+RandomRange(100);
|
||||
|
||||
if (dogib)
|
||||
ang = NORM_ANGLE(ang + 512 + RandomRange(200));
|
||||
ang = ang + DAngle90 + DAngle::fromBuild(RandomRange(200));
|
||||
else
|
||||
ang = NORM_ANGLE(ang+1024+256 - RandomRange(256));
|
||||
|
||||
nx = actor->int_pos().X;
|
||||
ny = actor->int_pos().Y;
|
||||
nz = int_ActorZOfTop(actor)-20;
|
||||
ang = ang + DAngle180 + DAngle45 - DAngle::fromBuild(RandomRange(256));
|
||||
|
||||
// Spawn a shot
|
||||
auto actorNew = SpawnActor(STAT_MISSILE, GOREDrip, s_BloodSprayChunk, actor->sector(),
|
||||
nx, ny, nz, ang, vel*2);
|
||||
ActorVectOfTop(actor).plusZ(- 20/256.), ang, vel*2);
|
||||
|
||||
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
|
||||
if (dogib)
|
||||
|
@ -2106,7 +2100,7 @@ int DoFlag(DSWActor* actor)
|
|||
// attach weapon to sprite
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
SetAttach(hitActor, actor);
|
||||
actor->user.pos.Z = hitActor->spr.pos.Z - (int_ActorSizeZ(hitActor) >> 1) * zinttoworld;
|
||||
actor->user.pos.Z = hitActor->spr.pos.Z - ActorSizeZ(hitActor) * 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue