- most InsertActor calls.

This commit is contained in:
Christoph Oelckers 2021-11-24 19:13:20 +01:00
parent cab2181ddc
commit d1f156dec3
7 changed files with 18 additions and 14 deletions

View file

@ -1155,7 +1155,7 @@ void BunnyHatch(DSWActor* actor)
for (int i = 0; i < MAX_BUNNYS; i++)
{
auto actorNew = InsertActor(sp->sectnum, STAT_DEFAULT);
auto actorNew = InsertActor(sp->sector(), STAT_DEFAULT);
np = &actorNew->s();
np->clear();
np->sectnum = sp->sectnum;
@ -1220,7 +1220,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
SPRITEp wp = &actor->s();
auto actorNew = InsertActor(wp->sectnum, STAT_DEFAULT);
auto actorNew = InsertActor(wp->sector(), STAT_DEFAULT);
auto np = &actorNew->s();
np->clear();
np->sectnum = wp->sectnum;

View file

@ -2107,6 +2107,10 @@ void SetSpikeActive(DSWActor*); // spike.c
#define NTAG_SEARCH_LO_HI 3
DSWActor* InsertActor(int sectnum, int statnum);
inline DSWActor* InsertActor(sectortype* sect, int statnum)
{
return InsertActor(sectnum(sect), statnum);
}
void AudioUpdate(void); // stupid

View file

@ -54,7 +54,7 @@ BEGIN_SW_NS
void CopyQuakeSpotToOn(SPRITEp sp)
{
auto actorNew = InsertActor(sp->sectnum, STAT_QUAKE_SPOT);
auto actorNew = InsertActor(sp->sector(), STAT_QUAKE_SPOT);
auto np = &actorNew->s();
memcpy(np, sp, sizeof(SPRITE));

View file

@ -1217,7 +1217,7 @@ void RipperHatch(DSWActor* actor)
for (int i = 0; i < MAX_RIPPERS; i++)
{
auto actorNew = InsertActor(wp->sectnum, STAT_DEFAULT);
auto actorNew = InsertActor(wp->sector(), STAT_DEFAULT);
np = &actorNew->s();
np->clear();
ClearOwner(actorNew);

View file

@ -1234,7 +1234,7 @@ void Ripper2Hatch(DSWActor* actor)
for (int i = 0; i < MAX_RIPPER2S; i++)
{
auto actorNew = InsertActor(wp->sectnum, STAT_DEFAULT);
auto actorNew = InsertActor(wp->sector(), STAT_DEFAULT);
np = &actorNew->s();
np->clear();
ClearOwner(actorNew);

View file

@ -992,7 +992,7 @@ bool ActorTestSpawn(DSWActor* actor)
auto sp = &actor->s();
if (sp->statnum == STAT_DEFAULT && sp->lotag == TAG_SPAWN_ACTOR)
{
auto actorNew = InsertActor(sp->sectnum, STAT_DEFAULT);
auto actorNew = InsertActor(sp->sector(), STAT_DEFAULT);
int t = actorNew->s().time; // must be preserved!
actorNew->s() = *sp;
actorNew->s().time = t;
@ -2653,7 +2653,7 @@ void SpriteSetup(void)
change_actor_stat(actor, STAT_CLIMB_MARKER);
// make a QUICK_LADDER sprite automatically
auto ns = InsertActor(sp->sectnum, STAT_QUICK_LADDER);
auto ns = InsertActor(sp->sector(), STAT_QUICK_LADDER);
auto np = &ns->s();
np->cstat = 0;
@ -3706,7 +3706,7 @@ int ActorCoughItem(DSWActor* actor)
{
case SAILORGIRL_R0:
ASSERT(sp->sectnum >= 0);
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
actorNew = InsertActor(sp->sector(), STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
@ -3747,7 +3747,7 @@ int ActorCoughItem(DSWActor* actor)
return 0;
ASSERT(sp->sectnum >= 0);
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
actorNew = InsertActor(sp->sector(), STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
@ -3775,7 +3775,7 @@ int ActorCoughItem(DSWActor* actor)
return 0;
ASSERT(sp->sectnum >= 0);
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
actorNew = InsertActor(sp->sector(), STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
@ -3806,7 +3806,7 @@ int ActorCoughItem(DSWActor* actor)
return 0;
ASSERT(sp->sectnum >= 0);
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
actorNew = InsertActor(sp->sector(), STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = 0;
np->extra = 0;
@ -3869,7 +3869,7 @@ int ActorCoughItem(DSWActor* actor)
return 0;
ASSERT(sp->sectnum >= 0);
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
actorNew = InsertActor(sp->sector(), STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
@ -3927,7 +3927,7 @@ int ActorCoughItem(DSWActor* actor)
case PACHINKO4:
ASSERT(sp->sectnum >= 0);
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
actorNew = InsertActor(sp->sector(), STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;

View file

@ -320,7 +320,7 @@ DSWActor* TrackClonePoint(DSWActor* actor)
{
SPRITEp sp = &actor->s(), np;
auto actorNew = InsertActor(sp->sectnum, sp->statnum);
auto actorNew = InsertActor(sp->sector(), sp->statnum);
np = &actorNew->s();