bool recount_ready = false;
PlayerState_detach(this);
+ bool was_player = false;
if (IS_PLAYER(this))
{
if(GetResource(this, RES_HEALTH) >= 1)
if (warmup_stage || game_starttime > time) /* warmup OR countdown */ recount_ready = true;
}
entcs_update_players(this);
+ was_player = true;
}
if (use_spawnpoint)
this.revival_time = 0;
this.draggable = drag_undraggable;
- player_powerups_remove_all(this);
+ player_powerups_remove_all(this, was_player);
this.items = 0;
STAT(WEAPONS, this) = '0 0 0';
this.drawonlytoclient = this;
.string shootfromfixedorigin;
.entity chatbubbleentity;
-void player_powerups_remove_all(entity this);
+void player_powerups_remove_all(entity this, bool allow_poweroff_sound);
/*
=============
if (warmup_stage || game_starttime > time) /* warmup OR countdown */ ReadyCount();
if (vote_called && IS_REAL_CLIENT(this)) VoteCount(false);
- player_powerups_remove_all(this); // stop powerup sound
+ player_powerups_remove_all(this, IS_PLAYER(this)); // stop powerup sound
ONREMOVE(this);
}
// it removes special powerups not handled by StatusEffects
-void player_powerups_remove_all(entity this)
+void player_powerups_remove_all(entity this, bool allow_poweroff_sound)
{
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)
+ if (allow_poweroff_sound && time > game_starttime + 1 && IS_CLIENT(this)
&& !(start_items & (IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS)))
{
sound(this, CH_INFO, SND_POWEROFF, VOL_BASE, ATTEN_NORM);
this.effects &= ~EF_NODEPTHTEST;
if (IS_DEAD(this))
- player_powerups_remove_all(this);
+ player_powerups_remove_all(this, true);
if((this.alpha < 0 || IS_DEAD(this)) && !this.vehicle) // don't apply the flags if the player is gibbed
return;
}
void play_countdown(entity this, float finished, Sound samp);
-void player_powerups_remove_all(entity this);
+void player_powerups_remove_all(entity this, bool allow_poweroff_sound);
// NOTE: current type is Resource (avoiding circular includes!)
void RotRegen(entity this, entity current, float limit_mod,