-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.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)
{
}
void weapon_defaultspawnfunc(float wpn)
-{
+{SELFPARAM();
entity e;
float t;
string s;
- entity oldself;
float i, j;
int f;
}
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)
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(strzone(e.m_model.model_str()), string_null, self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
+ self.item_pickupsound_ent = SND_WEAPONPICKUP;
#if 0 // WEAPONTODO
- if (self.modelindex) // don't precache if self was removed
- WEP_ACTION(e.weapon, WR_INIT);
+ if (self.modelindex) { // don't precache if self was removed
+ Weapon w = get_weaponinfo(e.weapon);
+ w.wr_init(w);
+ }
#endif
}