X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fspawning.qc;h=62b11ea45d62e47e3bc9c3d7244b05837e39c737;hb=04692f3bf447ec38a1bbb0a330c288bbe7a42726;hp=578c941f7f123528dc29318c2a17dce989e5f805;hpb=7bcb3a89b3271e018da4d92437dc5ba125ea8698;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 578c941f7..62b11ea45 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -1,9 +1,9 @@ #include "spawning.qh" #include "weaponsystem.qh" -#include "../mutators/all.qh" +#include "../mutators/_mod.qh" #include -#include +#include string W_Apply_Weaponreplace(string in) { @@ -29,17 +29,17 @@ void weapon_defaultspawnfunc(entity this, Weapon e) { if (e.spawnflags & WEP_FLAG_MUTATORBLOCKED) { - objerror("Attempted to spawn a mutator-blocked weapon rejected"); + LOG_WARNF("Attempted to spawn a mutator-blocked weapon rejected: prvm_edict server %i", this); startitem_failed = true; return; } string s = W_Apply_Weaponreplace(e.netname); MUTATOR_CALLHOOK(SetWeaponreplace, this, e, s); - s = ret_string; + s = M_ARGV(2, string); if (s == "") { - remove(this); + delete(this); startitem_failed = true; return; } @@ -50,7 +50,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e) for (int i = 1; i < t; ++i) { s = argv(i); - FOREACH(Weapons, it != WEP_Null, LAMBDA( + FOREACH(Weapons, it != WEP_Null, { if(it.netname == s) { entity replacement = spawn(); @@ -59,24 +59,24 @@ void weapon_defaultspawnfunc(entity this, Weapon e) weapon_defaultspawnfunc(replacement, it); break; } - )); + }); } } if (t >= 1) // always the case! { s = argv(0); wpn = WEP_Null; - FOREACH(Weapons, it != WEP_Null, LAMBDA( + FOREACH(Weapons, it != WEP_Null, { if(it.netname == s) { wpn = it; break; } - )); + }); } if (wpn == WEP_Null) { - remove(this); + delete(this); startitem_failed = true; return; } @@ -133,6 +133,9 @@ void weapon_defaultspawnfunc(entity this, Weapon e) if (g_pickup_weapons_anyway) this.pickup_anyway = true; + if(!this.owner) + this.glowmod = wpn.wpcolor; + GameItem def = wpn.m_pickup; _StartItem( this,