From 870036c730552c4d28d64f4d0ee0cde01d17f794 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 20 Jul 2021 11:09:33 +1000 Subject: [PATCH] Support the count field on powerups --- qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh | 2 +- qcsrc/common/mutators/mutator/powerups/powerup/shield.qh | 2 +- qcsrc/common/mutators/mutator/powerups/powerup/speed.qh | 2 +- qcsrc/common/mutators/mutator/powerups/powerup/strength.qh | 2 +- qcsrc/common/mutators/mutator/powerups/sv_powerups.qh | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh index 294daaabe..a0d1d7655 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh @@ -22,7 +22,7 @@ float autocvar_g_balance_powerup_invisibility_time = 30; void powerup_invisibility_init(Pickup this, entity item) { if(!item.invisibility_finished) - item.invisibility_finished = autocvar_g_balance_powerup_invisibility_time; + item.invisibility_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invisibility_time; } #endif REGISTER_ITEM(Invisibility, Powerup) { diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh index 4c273c0f2..4267889ac 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/shield.qh @@ -21,7 +21,7 @@ float autocvar_g_balance_powerup_invincible_time; void powerup_shield_init(Pickup this, entity item) { if(!item.invincible_finished) - item.invincible_finished = autocvar_g_balance_powerup_invincible_time; + item.invincible_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invincible_time; } #endif REGISTER_ITEM(Shield, Powerup) { diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh index 76f87ce57..6b127e39f 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/speed.qh @@ -23,7 +23,7 @@ float autocvar_g_balance_powerup_speed_time = 30; void powerup_speed_init(Pickup this, entity item) { if(!item.speed_finished) - item.speed_finished = autocvar_g_balance_powerup_speed_time; + item.speed_finished = (item.count) ? item.count : autocvar_g_balance_powerup_speed_time; } #endif REGISTER_ITEM(Speed, Powerup) { diff --git a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh index c594568f3..81d939e67 100644 --- a/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh +++ b/qcsrc/common/mutators/mutator/powerups/powerup/strength.qh @@ -23,7 +23,7 @@ float autocvar_g_balance_powerup_strength_time; void powerup_strength_init(Pickup this, entity item) { if(!item.strength_finished) - item.strength_finished = autocvar_g_balance_powerup_strength_time; + item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time; } #endif REGISTER_ITEM(Strength, Powerup) { diff --git a/qcsrc/common/mutators/mutator/powerups/sv_powerups.qh b/qcsrc/common/mutators/mutator/powerups/sv_powerups.qh index f71025959..c2dcfa034 100644 --- a/qcsrc/common/mutators/mutator/powerups/sv_powerups.qh +++ b/qcsrc/common/mutators/mutator/powerups/sv_powerups.qh @@ -10,3 +10,6 @@ REGISTER_MUTATOR(powerups, true); .float prevstrengthsound; .float prevstrengthsoundattempt; + +// q3compat +.float count; -- 2.39.2