- Fixed the PowerTimeFreezer, too. It got easier once I realized that I only

need to be concerned about changing the flag on odd tics, since A_Tracer()
  is called every two tics, not four.


SVN r584 (trunk)
This commit is contained in:
Randy Heit 2007-12-07 05:12:30 +00:00
parent 0adaaeb5d7
commit cc9dc13f55
2 changed files with 32 additions and 6 deletions

View File

@ -1,4 +1,7 @@
December 6, 2007
- Fixed the PowerTimeFreezer, too. It got easier once I realized that I only
need to be concerned about changing the flag on odd tics, since A_Tracer()
is called every two tics, not four.
- Fixed: Using the freeze command would make the Revenant missiles switch
their seekingness. The only sane way to deal with this seemed to be to
sync the freeze changes with the timer check in A_Tracer(), so that's what

View File

@ -1395,8 +1395,22 @@ void APowerTimeFreezer::InitEffect( )
}
}
// Finally, freeze the game.
level.flags|= LEVEL_FROZEN;
// [RH] The effect ends one tic after the counter hits zero, so make
// sure we start at an odd count.
EffectTics += !(EffectTics & 1);
if ((EffectTics & 1) == 0)
{
EffectTics++;
}
// Make sure the effect starts and ends on an even tic.
if ((level.time & 1) == 0)
{
level.flags |= LEVEL_FROZEN;
}
else
{
EffectTics++;
}
}
//===========================================================================
@ -1408,11 +1422,20 @@ void APowerTimeFreezer::InitEffect( )
void APowerTimeFreezer::DoEffect( )
{
Super::DoEffect();
// [RH] Do not change LEVEL_FROZEN on odd tics, or the Revenant's tracer
// will get thrown off.
if (level.time & 1)
{
return;
}
// [RH] The "blinking" needs to check against level.time, not EffectTics,
// or it will never happen, because InitEffect ensures that EffectTics will
// always be odd when level.time is even.
if ( EffectTics > 4*32
|| (( EffectTics > 3*32 && EffectTics <= 4*32 ) && EffectTics % 16 != 0 )
|| (( EffectTics > 2*32 && EffectTics <= 3*32 ) && EffectTics % 8 != 0 )
|| (( EffectTics > 32 && EffectTics <= 2*32 ) && EffectTics % 4 != 0 )
|| (( EffectTics > 0 && EffectTics <= 1*32 ) && EffectTics % 2 != 0 ))
|| (( EffectTics > 3*32 && EffectTics <= 4*32 ) && (level.time & 15) != 0 )
|| (( EffectTics > 2*32 && EffectTics <= 3*32 ) && (level.time & 7) != 0 )
|| (( EffectTics > 32 && EffectTics <= 2*32 ) && (level.time & 3) != 0 )
|| (( EffectTics > 0 && EffectTics <= 1*32 ) && (level.time & 1) != 0 ))
level.flags |= LEVEL_FROZEN;
else
level.flags &= ~LEVEL_FROZEN;