X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fspawning.qc;h=4ab5a43717c14e472bc30f0e5cdf6ab98d6bbbb7;hb=791f300d2660d6b75a51c6e7f302d6fa6b64861a;hp=d47351cb37a727aab87f100d2ccb61ddd98a5824;hpb=f84d4c215d826d9b035e1ba79a22af077f123f55;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index d47351cb3..4ab5a4371 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -2,7 +2,7 @@ #include "weaponsystem.qh" #include "../resources.qh" -#include "../mutators/_mod.qh" +#include #include #include #include @@ -56,29 +56,20 @@ void weapon_defaultspawnfunc(entity this, Weapon e) for (int i = 1; i < t; ++i) { s = argv(i); - FOREACH(Weapons, it != WEP_Null, { - if(it.netname == s) - { - entity replacement = spawn(); - copyentity(this, replacement); - replacement.m_isreplaced = true; - weapon_defaultspawnfunc(replacement, it); - break; - } - }); + Weapon wep = Weapons_fromstr(s); + if(wep != WEP_Null) + { + entity replacement = spawn(); + copyentity(this, replacement); + replacement.m_isreplaced = true; + weapon_defaultspawnfunc(replacement, wep); + } } } if (t >= 1) // always the case! { s = argv(0); - wpn = WEP_Null; - FOREACH(Weapons, it != WEP_Null, { - if(it.netname == s) - { - wpn = it; - break; - } - }); + wpn = Weapons_fromstr(s); } if (wpn == WEP_Null) { @@ -88,6 +79,13 @@ void weapon_defaultspawnfunc(entity this, Weapon e) } } + if (!Item_IsDefinitionAllowed(wpn.m_pickup)) + { + delete(this); + startitem_failed = true; + return; + } + if (!this.respawntime) { if (wpn.spawnflags & WEP_FLAG_SUPERWEAPON)