- many SpawnActor calls

This commit is contained in:
Christoph Oelckers 2022-08-22 18:43:10 +02:00
parent 2a8dd6b955
commit d8c7054751
4 changed files with 9 additions and 27 deletions

View file

@ -938,8 +938,7 @@ int DoChemBomb(DSWActor* actor)
// if you haven't bounced or your going slow do some puffs
if (!(actor->user.Flags & (SPR_BOUNCE | SPR_UNDERWATER)) && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{
auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->int_ang(), 100);
auto actorNew = SpawnActor(STAT_MISSILE, PUFF, s_Puff, actor->sector(), actor->spr.pos, actor->spr.angle, 100);
SetOwner(actor, actorNew);
actorNew->spr.shade = -40;
@ -1168,7 +1167,7 @@ int SpawnRadiationCloud(DSWActor* actor)
return -1;
auto actorNew = SpawnActor(STAT_MISSILE, RADIATION_CLOUD, s_RadiationCloud, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - RANDOM_P2(Z(8)), actor->int_ang(), 0);
actor->spr.pos.plusZ(-RANDOM_P2F(8, 8)), actor->spr.angle, 0);
SetOwner(GetOwner(actor), actorNew);
actorNew->user.WaitTics = 1 * 120;
@ -1567,7 +1566,7 @@ void SpawnFlashBombOnActor(DSWActor* actor)
}
auto actorNew = SpawnActor(STAT_MISSILE, FIREBALL_FLAMES, s_FireballFlames, actor->sector(),
actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->int_ang(), 0);
actor->spr.pos, actor->spr.angle, 0);
if (actor != nullptr)
actor->user.flameActor = actorNew;
@ -1670,18 +1669,12 @@ int PlayerInitCaltrops(PLAYER* pp)
int InitCaltrops(DSWActor* actor)
{
int nx, ny, nz;
PlaySound(DIGI_THROW, actor, v3df_dontpan | v3df_doppler);
nx = actor->int_pos().X;
ny = actor->int_pos().Y;
nz = actor->int_pos().Z;
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, actor->sector(),
nx, ny, nz, actor->int_ang(), CHEMBOMB_VELOCITY / 2);
actor->spr.pos, actor->spr.angle, CHEMBOMB_VELOCITY / 2);
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
@ -1711,21 +1704,12 @@ int InitCaltrops(DSWActor* actor)
int InitPhosphorus(DSWActor* actor)
{
int nx, ny, nz;
short daang;
PlaySound(DIGI_FIREBALL1, actor, v3df_follow);
nx = actor->int_pos().X;
ny = actor->int_pos().Y;
nz = actor->int_pos().Z;
daang = NORM_ANGLE(RandomRange(2048));
// Spawn a shot
// Inserting and setting up variables
auto actorNew = SpawnActor(STAT_SKIP4, FIREBALL1, s_Phosphorus, actor->sector(),
nx, ny, nz, daang, CHEMBOMB_VELOCITY/3);
actor->spr.pos, RANDOM_ANGLE(), CHEMBOMB_VELOCITY/3);
actorNew->spr.hitag = LUMINOUS; // Always full brightness
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);

View file

@ -2322,8 +2322,7 @@ void InitPlayerSprite(PLAYER* pp)
COVER_SetReverb(0); // Turn off any echoing that may have been going before
pp->Reverb = 0;
auto actor = SpawnActor(STAT_PLAYER0 + pnum, NINJA_RUN_R0, nullptr, pp->cursector, pp->int_ppos().X,
pp->int_ppos().Y, pp->int_ppos().Z, pp->angle.ang.Buildang(), 0);
auto actor = SpawnActor(STAT_PLAYER0 + pnum, NINJA_RUN_R0, nullptr, pp->cursector, pp->pos, pp->angle.ang, 0);
pp->actor = actor;
pp->pnum = pnum;
@ -2391,7 +2390,7 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
int pnum = int(pp - Player);
pp->PlayerUnderActor = SpawnActor(STAT_PLAYER_UNDER0 + pnum,
NINJA_RUN_R0, nullptr, pp->cursector, pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, pp->angle.ang.Buildang(), 0);
NINJA_RUN_R0, nullptr, pp->cursector, pp->pos, pp->angle.ang, 0);
DSWActor* actor = pp->PlayerUnderActor;

View file

@ -6858,7 +6858,7 @@ void InitMultiPlayerInfo(void)
continue;
}
auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector, pp->int_ppos().X, pp->int_ppos().Y, pp->int_ppos().Z, pp->angle.ang.Buildang(), 0);
auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector, pp->pos, pp->angle.ang, 0);
start0->clearUser();
start0->spr.picnum = ST1;
}

View file

@ -1017,8 +1017,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
sop->track = sectp->hitag;
// spawn a sprite to make it easier to integrate with sprite routines
auto actorNew = SpawnActor(STAT_SO_SP_CHILD, 0, nullptr, sectp,
sop->int_pmid().X, sop->int_pmid().Y, sop->int_pmid().Z, 0, 0);
auto actorNew = SpawnActor(STAT_SO_SP_CHILD, 0, nullptr, sectp, sop->pmid, nullAngle, 0);
sop->sp_child = actorNew;
actorNew->user.sop_parent = sop;
actorNew->user.Flags2 |= (SPR2_SPRITE_FAKE_BLOCK); // for damage test