- minor cleanup.

This commit is contained in:
Christoph Oelckers 2022-11-20 22:07:10 +01:00
parent 76fabcd1c7
commit 7188956702
4 changed files with 28 additions and 14 deletions

View file

@ -526,11 +526,19 @@ void moveplayers(void)
//
//---------------------------------------------------------------------------
void movefx(void)
void tickstat(int stat)
{
DukeStatIterator iti(STAT_FX);
DukeStatIterator iti(stat);
while (auto act = iti.Next())
CallTick(act);
{
if (actorflag(act, SFLAG2_DIENOW))
{
act->Destroy();
continue;
}
if (act->GetClass() != RUNTIME_CLASS(DDukeActor))
CallTick(act);
}
}
//---------------------------------------------------------------------------

View file

@ -3283,7 +3283,7 @@ void think_d(void)
moveeffectors_d(); //ST 3
movestandables_d(); //ST 6
doanimations();
movefx(); //ST 11
tickstat(STAT_FX); //ST 11
thinktime.Unclock();
}

View file

@ -1881,10 +1881,22 @@ static void rrra_specialstats()
//---------------------------------------------------------------------------
//
//
// this one's a hack. Can only be replaced with something better when
// the switch code has been redone.
//
//---------------------------------------------------------------------------
void resetswitch(int tag)
{
DukeStatIterator it2(STAT_DEFAULT);
while (auto act2 = it2.Next())
{
if (act2->spr.picnum == DIPSWITCH3 + 1)
if (act2->spr.hitag == tag)
act2->spr.picnum = DIPSWITCH3;
}
}
void rr_specialstats()
{
DukeStatIterator it(STAT_LUMBERMILL);
@ -1906,13 +1918,7 @@ void rr_specialstats()
act->spr.pos.Z = act->sector()->floorz - 59.25;
act->spr.extra = 0;
act->spr.picnum = LUMBERBLADE1;
DukeStatIterator it2(STAT_DEFAULT);
while (auto act2 = it2.Next())
{
if (act2->spr.picnum == DIPSWITCH3 + 1)
if (act2->spr.hitag == 999)
act2->spr.picnum = DIPSWITCH3;
}
resetswitch(999);
}
}
}
@ -3581,7 +3587,7 @@ void think_r(void)
moveeffectors_r(); //ST 3
movestandables_r(); //ST 6
doanimations();
movefx(); //ST 11
tickstat(STAT_FX); //ST 11
if (numplayers < 2 && thunderon)
thunder();

View file

@ -26,7 +26,7 @@ void movedummyplayers(void);
void resetlanepics(void);
void moveplayers();
void doanimations();
void movefx();
void tickstat(int stat);
void operaterespawns(int low);
void moveclouds(double interpfrac);
void movefta();