From: LegendaryGuard Date: Tue, 16 Feb 2021 18:09:55 +0000 (+0100) Subject: Fix Ammunitioning nade if other ammo is filled X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=48c5fd1ca886fe44523318f435589b13f9a92319;p=xonotic%2Fxonotic-data.pk3dir.git Fix Ammunitioning nade if other ammo is filled --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index a5b4a39c3..0818c9ca4 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -805,16 +805,48 @@ void nade_ammo_touch(entity this, entity toucher) } if ( ammo_factor > 0 ) { - if ((amshells < maxammo) && (ambullets < maxammo) && (amrockets < maxammo) && (amcells < maxammo) && (amplasma < maxammo)) + if (amshells < maxammo) { if (this.nade_show_particles) { Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1); } GiveResourceWithLimit(toucher, RES_SHELLS, ammo_factor, maxammo); + } + + if (ambullets < maxammo) + { + if (this.nade_show_particles) + { + Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1); + } GiveResourceWithLimit(toucher, RES_BULLETS, ammo_factor, maxammo); + } + + if (amrockets < maxammo) + { + if (this.nade_show_particles) + { + Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1); + } GiveResourceWithLimit(toucher, RES_ROCKETS, ammo_factor, maxammo); + } + + if (amcells < maxammo) + { + if (this.nade_show_particles) + { + Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1); + } GiveResourceWithLimit(toucher, RES_CELLS, ammo_factor, maxammo); + } + + if (amplasma < maxammo) + { + if (this.nade_show_particles) + { + Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1); + } GiveResourceWithLimit(toucher, RES_PLASMA, ammo_factor, maxammo); } }