]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix Extralife pickup sound stopping long powerup sounds
authorterencehill <piuntn@gmail.com>
Fri, 19 May 2023 21:58:35 +0000 (23:58 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 19 May 2023 21:58:35 +0000 (23:58 +0200)
qcsrc/server/items/items.qc

index c36f843762092ade68858ee1c6fe130b6b8aa604..57720ef9aff2e29fe8912ba276d50bb379e58600 100644 (file)
@@ -702,7 +702,10 @@ LABEL(pickup)
        STAT(LAST_PICKUP, toucher) = time;
 
        Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
-       _sound (toucher, (this.itemdef.instanceOfPowerup ? CH_TRIGGER_SINGLE : CH_TRIGGER), (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM);
+       GameItem def = this.itemdef;
+       int ch = ((def.instanceOfPowerup && def.m_itemid != IT_RESOURCE) ? CH_TRIGGER_SINGLE : CH_TRIGGER);
+       string snd = (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent));
+       _sound(toucher, ch, snd, VOL_BASE, ATTEN_NORM);
 
        MUTATOR_CALLHOOK(ItemTouched, this, toucher);
        if (wasfreed(this))