From: Mario Date: Thu, 15 Oct 2015 18:34:31 +0000 (+1000) Subject: Add map options to disable item animation and the pickup_anyway flag X-Git-Tag: xonotic-v0.8.2~1814 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=873a782e14d3232d642a447bab87dd5546776d66;p=xonotic%2Fxonotic-data.pk3dir.git Add map options to disable item animation and the pickup_anyway flag --- diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 568789c62..51be9fa84 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -574,7 +574,7 @@ float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax if (item.spawnshieldtime) { - if ((player.(ammotype) < ammomax) || item.pickup_anyway) + if ((player.(ammotype) < ammomax) || item.pickup_anyway > 0) { player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype)); goto YEAH; @@ -645,7 +645,7 @@ float Item_GiveTo(entity item, entity player) it = item.weapons; it &= ~player.weapons; - if (it || (item.spawnshieldtime && item.pickup_anyway)) + if (it || (item.spawnshieldtime && item.pickup_anyway > 0)) { pickedup = true; for(i = WEP_FIRST; i <= WEP_LAST; ++i) @@ -1155,11 +1155,14 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, self.SendFlags |= ISF_SIZE; - if(itemflags & FL_POWERUP) - self.ItemStatus |= ITS_ANIMATE1; + if(!(self.spawnflags & 1024)) + { + if(itemflags & FL_POWERUP) + self.ItemStatus |= ITS_ANIMATE1; - if(self.armorvalue || self.health) - self.ItemStatus |= ITS_ANIMATE2; + if(self.armorvalue || self.health) + self.ItemStatus |= ITS_ANIMATE2; + } if(itemflags & FL_WEAPON) { @@ -1168,7 +1171,8 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, else self.gravity = 1; - self.ItemStatus |= ITS_ANIMATE1; + if(!(self.spawnflags & 1024)) + self.ItemStatus |= ITS_ANIMATE1; self.ItemStatus |= ISF_COLORMAP; }