X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Ft_items.qc;h=4a3712a25b31a02aac9b1e8d429933fb0463ca33;hp=6b04c98b069044428af14c76b7b316b6692198ab;hb=3c1e56f26fd675c3606d34b3afa94e3889ff4350;hpb=f20be079648c06c940d13b62d7c1bbf68139a231 diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 6b04c98b0..4a3712a25 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -927,6 +927,9 @@ void Item_Touch(entity this, entity toucher) LABEL(pickup) + if(this.target && this.target != "" && this.target != "###item###") // defrag support + SUB_UseTargets(this, toucher, NULL); + STAT(LAST_PICKUP, toucher) = time; Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1); @@ -1314,7 +1317,11 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default || (def.instanceOfHealth && def != ITEM_HealthSmall) || (def.instanceOfArmor && def != ITEM_ArmorSmall) || (itemid & (IT_KEY1 | IT_KEY2)) - ) this.target = "###item###"; // for finding the nearest item using findnearest + ) + { + if(!this.target || this.target == "") + this.target = "###item###"; // for finding the nearest item using findnearest + } Item_ItemsTime_SetTime(this, 0); } @@ -1762,7 +1769,7 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveResourceValue(e, RES_HEALTH, op, val); got += GiveResourceValue(e, RES_ARMOR, op, val); case "allweapons": - FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & WEP_FLAG_MUTATORBLOCKED), got += GiveWeapon(e, it.m_id, op, val)); + FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)), got += GiveWeapon(e, it.m_id, op, val)); //case "allbuffs": // all buffs makes a player god, do not want! //FOREACH(Buffs, it != BUFF_Null, got += GiveBuff(e, it.m_itemid, op, val)); case "allammo":