buff_RemoveAll(toucher, STATUSEFFECT_REMOVE_NORMAL); // remove previous buffs so that a new one may be added
if(bufftime)
- StatusEffects_apply(thebuff, toucher, min(time + bufftime, max(oldtime, time) + bufftime), 0);
+ StatusEffects_apply(thebuff, toucher, min(time + bufftime, oldtime + bufftime), 0);
else
StatusEffects_apply(thebuff, toucher, time + 999, 0); // HACK: zero timer means "infinite"!
else
{
play_countdown(this, StatusEffects_gettime(STATUSEFFECT_Superweapons, this), SND_POWEROFF);
- if (time > StatusEffects_gettime(STATUSEFFECT_Superweapons, this))
+ if (time >= StatusEffects_gettime(STATUSEFFECT_Superweapons, this))
{
this.items = this.items - (this.items & IT_SUPERWEAPON);
STAT(WEAPONS, this) &= ~WEPSET_SUPERWEAPONS;
if (item.strength_finished)
{
pickedup = true;
- float t = max(StatusEffects_gettime(STATUSEFFECT_Strength, player), time);
+ float t = StatusEffects_gettime(STATUSEFFECT_Strength, player);
if (autocvar_g_powerups_stack)
t += item.strength_finished;
else
if (item.invincible_finished)
{
pickedup = true;
- float t = max(StatusEffects_gettime(STATUSEFFECT_Shield, player), time);
+ float t = StatusEffects_gettime(STATUSEFFECT_Shield, player);
if (autocvar_g_powerups_stack)
t += item.invincible_finished;
else
if (item.speed_finished)
{
pickedup = true;
- float t = max(StatusEffects_gettime(STATUSEFFECT_Speed, player), time);
+ float t = StatusEffects_gettime(STATUSEFFECT_Speed, player);
if (autocvar_g_powerups_stack)
t += item.speed_finished;
else
if (item.invisibility_finished)
{
pickedup = true;
- float t = max(StatusEffects_gettime(STATUSEFFECT_Invisibility, player), time);
+ float t = StatusEffects_gettime(STATUSEFFECT_Invisibility, player);
if (autocvar_g_powerups_stack)
t += item.invisibility_finished;
else
if (item.superweapons_finished)
{
pickedup = true;
- StatusEffects_apply(STATUSEFFECT_Superweapons, player, max(StatusEffects_gettime(STATUSEFFECT_Superweapons, player), time) + item.superweapons_finished, 0);
+ float t = StatusEffects_gettime(STATUSEFFECT_Superweapons, player);
+ StatusEffects_apply(STATUSEFFECT_Superweapons, player, t + item.superweapons_finished, 0);
}
// always eat teamed entities