From: terencehill Date: Tue, 8 Aug 2023 12:11:46 +0000 (+0200) Subject: Further improve onspawn nade refiring X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c4cd296cb93e2dca84eb333af04acc6143d5543c;p=xonotic%2Fxonotic-data.pk3dir.git Further improve onspawn nade refiring --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index eb7d1fa9b..01f78c05b 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -1671,13 +1671,13 @@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn) { entity player = M_ARGV(0, entity); - if (autocvar_g_nades_onspawn) - { - if (StatusEffects_active(STATUSEFFECT_SpawnShield, player)) - player.nade_refire = time + autocvar_g_spawnshieldtime; - } + if (StatusEffects_active(STATUSEFFECT_SpawnShield, player)) + player.nade_refire = StatusEffects_gettime(STATUSEFFECT_SpawnShield, player); else - player.nade_refire = time + autocvar_g_nades_nade_refire; + player.nade_refire = time; + + if (!autocvar_g_nades_onspawn) + player.nade_refire += autocvar_g_nades_nade_refire; if(autocvar_g_nades_bonus_client_select) STAT(NADE_BONUS_TYPE, player) = CS_CVAR(player).cvar_cl_nade_type;