]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/powerups/sv_powerups.qc
Apply strength sound and buff shield stats to the entity directly rather than player...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / powerups / sv_powerups.qc
index e727d493f899cd9a75cd8ff8c789fe4935f4e636..c4b79eb9c2a09ac5617367cb56efa03883965f78 100644 (file)
@@ -3,16 +3,15 @@
 MUTATOR_HOOKFUNCTION(powerups, W_PlayStrengthSound)
 {
        entity player = M_ARGV(0, entity);
-       entity store = IS_PLAYER(player) ? PS(player) : player; // because non-player entities can fire weapons
 
        if(StatusEffects_active(STATUSEFFECT_Strength, player)
-               && ((time > store.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
-               || (time > store.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
+               && ((time > player.prevstrengthsound + autocvar_sv_strengthsound_antispam_time) // prevent insane sound spam
+               || (time > player.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)))
                {
                        sound(player, CH_TRIGGER, SND_STRENGTH_FIRE, VOL_BASE, ATTEN_NORM);
-                       store.prevstrengthsound = time;
+                       player.prevstrengthsound = time;
                }
-       store.prevstrengthsoundattempt = time;
+       player.prevstrengthsoundattempt = time;
 }
 
 MUTATOR_HOOKFUNCTION(powerups, LogDeath_AppendItemCodes)