-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../sys-post.qh"
- #include "../../common/weapons/weapons.qh"
- #include "spawning.qh"
- #include "weaponsystem.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../mutators/mutators_include.qh"
-#endif
+#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)
{
{
replacement = "";
s = argv(i);
-
+
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
{
e = get_weaponinfo(j);
}
void weapon_defaultspawnfunc(float wpn)
-{
+{SELFPARAM();
entity e;
float t;
string s;
- entity oldself;
float i, j;
- float f;
+ int f;
if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
{
}
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 == "")
{
if(t >= 2)
{
self.team = --internalteam;
- oldself = self;
for(i = 1; i < t; ++i)
{
s = argv(i);
e = get_weaponinfo(j);
if(e.netname == s)
{
- self = spawn();
- copyentity(oldself, self);
+ setself(spawn());
+ copyentity(this, self);
self.classname = "replacedweapon";
weapon_defaultspawnfunc(j);
break;
}
if(j > WEP_LAST)
{
- print("The weapon replace list for ", oldself.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon replace list for ", this.classname, " contains an unknown weapon ", s, ". Skipped.\n");
}
}
- self = oldself;
+ setself(this);
}
if(t >= 1) // always the case!
{
}
if(j > WEP_LAST)
{
- print("The weapon replace list for ", self.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon replace list for ", self.classname, " contains an unknown weapon ", s, ". Skipped.\n");
}
}
if(wpn == 0)
StartItem(e.model, "weapons/weaponpickup.wav", 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);
+ _WEP_ACTION(e.weapon, WR_INIT);
#endif
}