X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fspawning.qc;h=684ea842b94a026146495ffb22db41416a7d1c15;hb=2d3ed896c16fcbad16cdf83b1ffae348053aab96;hp=ba17d3f1f893bdb2c42a7aa89fa4e674867ba548;hpb=0b81c8ddcc0fd34433e710dbfe2b55afe0d6d7eb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index ba17d3f1f..684ea842b 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -3,8 +3,8 @@ #include "weaponsystem.qh" #include "../resources.qh" #include -#include -#include +#include +#include #include .bool m_isreplaced; ///< Holds whether the weapon has been replaced. @@ -14,7 +14,7 @@ string W_Apply_Weaponreplace(string in) string out = ""; FOREACH_WORD(in, true, { string replacement = ""; - Weapon w = Weapons_fromstr(it); + Weapon w = Weapon_from_name(it); if (w) { replacement = w.weaponreplace; @@ -26,22 +26,21 @@ string W_Apply_Weaponreplace(string in) return out; } -void weapon_defaultspawnfunc(entity this, Weapon e) +void weapon_defaultspawnfunc(entity this, Weapon wpn) { - Weapon wpn = e; - e = wpn = wpn.m_spawnfunc_hookreplace(wpn, this); + wpn = wpn.m_spawnfunc_hookreplace(wpn, this); this.classname = wpn.m_canonical_spawnfunc; if (!Item_IsLoot(this) && !this.m_isreplaced) { - if (e.spawnflags & WEP_FLAG_MUTATORBLOCKED) + if (wpn.spawnflags & WEP_FLAG_MUTATORBLOCKED) { - LOG_WARNF("Attempted to spawn a mutator-blocked weapon rejected: prvm_edict server %i", this); + //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); + string s = W_Apply_Weaponreplace(wpn.netname); + MUTATOR_CALLHOOK(SetWeaponreplace, this, wpn, s); s = M_ARGV(2, string); if (s == "") { @@ -56,7 +55,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e) for (int i = 1; i < t; ++i) { s = argv(i); - Weapon wep = Weapons_fromstr(s); + Weapon wep = Weapon_from_name(s); if(wep != WEP_Null) { entity replacement = spawn(); @@ -69,7 +68,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e) if (t >= 1) // always the case! { s = argv(0); - wpn = Weapons_fromstr(s); + wpn = Weapon_from_name(s); } if (wpn == WEP_Null) { @@ -79,6 +78,9 @@ void weapon_defaultspawnfunc(entity this, Weapon e) } } + if(!Item_IsLoot(this)) + weaponsInMapAll |= WepSet_FromWeapon(wpn); + if (!Item_IsDefinitionAllowed(wpn.m_pickup)) { delete(this);