mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- did a clean reimplementation of resetswitch.
This commit is contained in:
parent
9bc0a43028
commit
97a5fc2948
2 changed files with 21 additions and 18 deletions
|
@ -1010,24 +1010,6 @@ static void rrra_specialstats()
|
|||
tickstat(STAT_RABBITSPAWN);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// 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 == RTILE_DIPSWITCH3ON)
|
||||
if (act2->spr.hitag == tag)
|
||||
act2->spr.picnum = RTILE_DIPSWITCH3;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
|
|
@ -1429,7 +1429,28 @@ void moveclouds(double interpfrac)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void resetswitch(int tag)
|
||||
{
|
||||
DukeStatIterator it2(STAT_DEFAULT);
|
||||
while (auto act2 = it2.Next())
|
||||
{
|
||||
auto& ext = GetExtInfo(act2->spr.spritetexture());
|
||||
if (ext.switchindex > 0 && ext.switchphase == 1 && act2->spr.hitag == tag)
|
||||
{
|
||||
auto& swdef = switches[ext.switchindex];
|
||||
if (swdef.type == SwitchDef::Regular && swdef.flags & SwitchDef::resettable)
|
||||
{
|
||||
act2->spr.setspritetexture(swdef.states[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
END_DUKE_NS
|
||||
|
|
Loading…
Reference in a new issue