StatusEffects_removeall(frag_target, STATUSEFFECT_REMOVE_NORMAL);
}
+MUTATOR_HOOKFUNCTION(status_effects, ClientDisconnect)
+{
+ entity player = M_ARGV(0, entity);
+
+ StatusEffects_removeall(player, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(status_effects, MakePlayerObserver)
{
entity player = M_ARGV(0, entity);
// no need to network updates, as there is no statuseffects object attached
+ StatusEffects_removeall(player, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
StatusEffects_clearall(player.statuseffects_store);
// don't delete spectatee's effects!
{
FOREACH_CLIENT(IS_PLAYER(it) && it.statuseffects,
{
+ StatusEffects_removeall(it, STATUSEFFECT_REMOVE_NORMAL); // just to get rid of the pickup sound
StatusEffects_clearall(it.statuseffects);
StatusEffects_update(it);
});
this.revival_time = 0;
this.draggable = drag_undraggable;
+ player_powerups_remove_all(this);
this.items = 0;
STAT(WEAPONS, this) = '0 0 0';
this.drawonlytoclient = this;
sound (this, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
}
+// it removes special powerups not handled by StatusEffects
void player_powerups_remove_all(entity this)
{
- if (this.items & IT_SUPERWEAPON)
+ if (this.items & (IT_SUPERWEAPON | IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS))
{
// don't play the poweroff sound when the game restarts or the player disconnects
if (time > game_starttime + 1 && IS_CLIENT(this))
sound(this, CH_INFO, SND_POWEROFF, VOL_BASE, ATTEN_NORM);
- stopsound(this, CH_TRIGGER_SINGLE); // get rid of the pickup sound
- this.items -= (this.items & IT_SUPERWEAPON);
+ if (this.items & (IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS))
+ stopsound(this, CH_TRIGGER_SINGLE); // get rid of the pickup sound
+ this.items -= (this.items & (IT_SUPERWEAPON | IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS));
}
}