From: z411 Date: Sat, 6 Nov 2021 21:27:43 +0000 (-0300) Subject: powerups_dropondeath: Use weapon despawn time for setting 2 X-Git-Tag: xonotic-v0.8.5~273^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6254f4f6e188b9030cab0857f3e45f0ded817727;p=xonotic%2Fxonotic-data.pk3dir.git powerups_dropondeath: Use weapon despawn time for setting 2 --- diff --git a/qcsrc/common/mutators/mutator/powerups/sv_powerups.qc b/qcsrc/common/mutators/mutator/powerups/sv_powerups.qc index 7491d853e..a4b24af13 100644 --- a/qcsrc/common/mutators/mutator/powerups/sv_powerups.qc +++ b/qcsrc/common/mutators/mutator/powerups/sv_powerups.qc @@ -90,19 +90,19 @@ void powerups_DropItem(entity this, StatusEffects effect) // If we want the timer to keep running, we enable expiring then use the exact time the powerup will finish at. // If we want the timer to freeze, we disable expiring and we just use the time left of the powerup. // See Item_SetExpiring() below. - float finished_time = (autocvar_g_powerups_dropondeath == 2 ? timeleft : t); + float finished = (autocvar_g_powerups_dropondeath == 2 ? timeleft : t); - // If the timer is frozen, the item will stay on the floor for 60 secs (TODO hardcoded for now), + // If the timer is frozen, the item will stay on the floor for 20 secs (same as weapons), // otherwise it'll disappear after the timer runs out. - float time_to_live = (autocvar_g_powerups_dropondeath == 2 ? 60 : timeleft); + float time_to_live = (autocvar_g_powerups_dropondeath == 2 ? 20 : timeleft); // TODO: items cannot hold their "item field" yet, so we need to list all the powerups here! switch(item) { - case ITEM_Strength: e.strength_finished = finished_time; break; - case ITEM_Shield: e.invincible_finished = finished_time; break; - case ITEM_Invisibility: e.invisibility_finished = finished_time; break; - case ITEM_Speed: e.speed_finished = finished_time; break; + case ITEM_Strength: e.strength_finished = finished; break; + case ITEM_Shield: e.invincible_finished = finished; break; + case ITEM_Invisibility: e.invisibility_finished = finished; break; + case ITEM_Speed: e.speed_finished = finished; break; } Item_InitializeLoot(e, item.m_canonical_spawnfunc, this.origin + '0 0 32', randomvec() * 175 + '0 0 175', time_to_live);