]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix `give no superweapons` giving default superweapons time
authorterencehill <piuntn@gmail.com>
Sun, 1 Sep 2024 12:24:22 +0000 (14:24 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 1 Sep 2024 12:24:22 +0000 (14:24 +0200)
It happened because GiveStatusEffect removed superweapons status effect and this code block added it back.

qcsrc/server/items/items.qc

index 7ceb2b62ff381461f6d73c4832a6f1066455de14..839f3ecc9d3ad4a95b9c40a2080700cb9fa9eee5 100644 (file)
@@ -1757,7 +1757,8 @@ float GiveItems(entity e, float beginarg, float endarg)
 
        if(!StatusEffects_active(STATUSEFFECT_Superweapons, e))
        {
-               if(!g_weaponarena && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
+               // also give default superweapon time if player had no superweapons and just got one
+               if(!g_weaponarena && !(save_weapons & WEPSET_SUPERWEAPONS) && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
                        StatusEffects_apply(STATUSEFFECT_Superweapons, e, time + autocvar_g_balance_superweapons_time, 0);
        }