#include "weaponsystem.qh"
#include "../resources.qh"
-#include "../mutators/_mod.qh"
+#include <server/mutators/_mod.qh>
#include <common/t_items.qh>
#include <server/items.qh>
#include <common/weapons/_all.qh>
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)
{
}
}
+ if (!Item_IsDefinitionAllowed(wpn.m_pickup))
+ {
+ delete(this);
+ startitem_failed = true;
+ return;
+ }
+
if (!this.respawntime)
{
if (wpn.spawnflags & WEP_FLAG_SUPERWEAPON)