- Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so

that additive time powerups can be activated before the existing
  power has entered its blink threshold.


SVN r1724 (trunk)
This commit is contained in:
Randy Heit 2009-07-17 01:32:58 +00:00
parent 720747baef
commit 198ffea7ee
2 changed files with 13 additions and 8 deletions

View file

@ -1,4 +1,7 @@
July 16, 2009 July 16, 2009
- Moved the IF_ADDITIVETIME check earlier in APowerup::HandlePickup so
that additive time powerups can be activated before the existing
power has entered its blink threshold.
- Added a "BlueMap" for powerup colors. - Added a "BlueMap" for powerup colors.
- Added a NULL screen check when detaching HUD messages. - Added a NULL screen check when detaching HUD messages.
- Added HotWax's A_SetArg. - Added HotWax's A_SetArg.

View file

@ -278,19 +278,21 @@ bool APowerup::HandlePickup (AInventory *item)
power->ItemFlags |= IF_PICKUPGOOD; power->ItemFlags |= IF_PICKUPGOOD;
return true; return true;
} }
// If it's not blinking yet, you can't replenish the power unless the // Color gets transferred if the new item has an effect.
// powerup is required to be picked up.
if (EffectTics > BLINKTHRESHOLD && !(power->ItemFlags & IF_ALWAYSPICKUP)) // Increase the effect's duration.
{
return true;
}
// Only increase the EffectTics, not decrease it.
// Color also gets transferred only when the new item has an effect.
if (power->ItemFlags & IF_ADDITIVETIME) if (power->ItemFlags & IF_ADDITIVETIME)
{ {
EffectTics += power->EffectTics; EffectTics += power->EffectTics;
BlendColor = power->BlendColor; BlendColor = power->BlendColor;
} }
// If it's not blinking yet, you can't replenish the power unless the
// powerup is required to be picked up.
else if (EffectTics > BLINKTHRESHOLD && !(power->ItemFlags & IF_ALWAYSPICKUP))
{
return true;
}
// Reset the effect duration.
else if (power->EffectTics > EffectTics) else if (power->EffectTics > EffectTics)
{ {
EffectTics = power->EffectTics; EffectTics = power->EffectTics;