X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fspawning.qc;h=d6d158f49b44702c53bda89a849e33ea9229de08;hb=d8825c487a0be97a0f132bb878bf3c1a13736b00;hp=04dd3f6f236efce1f44ddb2cd5ba52e9556d2b7b;hpb=7f6f6ddf5a60125f13cbc906c5e29faf61310d80;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 04dd3f6f2..d6d158f49 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -1,3 +1,11 @@ +#include "spawning.qh" +#include "../_all.qh" + +#include "weaponsystem.qh" +#include "../mutators/mutators_include.qh" +#include "../t_items.qh" +#include "../../common/weapons/all.qh" + string W_Apply_Weaponreplace(string in) { float n = tokenize_console(in); @@ -8,7 +16,7 @@ string W_Apply_Weaponreplace(string in) { replacement = ""; s = argv(i); - + for(j = WEP_FIRST; j <= WEP_LAST; ++j) { e = get_weaponinfo(j); @@ -33,7 +41,7 @@ void weapon_defaultspawnfunc(float wpn) string s; entity oldself; float i, j; - float f; + int f; if(self.classname != "droppedweapon" && self.classname != "replacedweapon") { @@ -42,19 +50,17 @@ void weapon_defaultspawnfunc(float wpn) if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED) { objerror("Attempted to spawn a mutator-blocked weapon rejected"); - startitem_failed = TRUE; + startitem_failed = true; return; } s = W_Apply_Weaponreplace(e.netname); - ret_string = s; - other = e; - MUTATOR_CALLHOOK(SetWeaponreplace); + MUTATOR_CALLHOOK(SetWeaponreplace, self, e, s); s = ret_string; if(s == "") { remove(self); - startitem_failed = TRUE; + startitem_failed = true; return; } t = tokenize_console(s); @@ -105,7 +111,7 @@ void weapon_defaultspawnfunc(float wpn) if(wpn == 0) { remove(self); - startitem_failed = TRUE; + startitem_failed = true; return; } } @@ -161,7 +167,7 @@ void weapon_defaultspawnfunc(float wpn) // pickup anyway if(g_pickup_weapons_anyway) - self.pickup_anyway = TRUE; + self.pickup_anyway = true; f = FL_WEAPON; @@ -173,7 +179,7 @@ void weapon_defaultspawnfunc(float wpn) if(self.team) f |= FL_NO_WEAPON_STAY; - StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue); + StartItem(e.model, W_Sound("weaponpickup"), self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue); #if 0 // WEAPONTODO if (self.modelindex) // don't precache if self was removed WEP_ACTION(e.weapon, WR_INIT);