]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Nades: Improved onspawn nade refiring
authorDark Blue <darkbluevector@gmail.com>
Mon, 7 Aug 2023 16:46:01 +0000 (19:46 +0300)
committerDark Blue <darkbluevector@gmail.com>
Mon, 7 Aug 2023 18:50:55 +0000 (21:50 +0300)
qcsrc/common/mutators/mutator/nades/nades.qc

index 12997c0b51f4211f87793e0db6890556521a0bf3..eb7d1fa9b0ed14862e7ce8b7baa5724cb56ca974 100644 (file)
@@ -1671,9 +1671,13 @@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn)
 {
        entity player = M_ARGV(0, entity);
 
-       player.nade_refire = (autocvar_g_nades_onspawn) 
-               ? time + autocvar_g_nades_nade_refire 
-               : time + autocvar_g_spawnshieldtime;
+       if (autocvar_g_nades_onspawn)
+       {
+               if (StatusEffects_active(STATUSEFFECT_SpawnShield, player))
+                       player.nade_refire = time + autocvar_g_spawnshieldtime;
+       }
+       else
+               player.nade_refire = time + autocvar_g_nades_nade_refire;
 
        if(autocvar_g_nades_bonus_client_select)
                STAT(NADE_BONUS_TYPE, player) = CS_CVAR(player).cvar_cl_nade_type;