#include <common/t_items.qh>
#include <common/animdecide.qh>
#include <common/constants.qh>
+#include <common/net_linked.qh>
#include <common/monsters/_mod.qh>
#include <common/notifications/all.qh>
#include <common/util.qh>
#include <common/weapons/_all.qh>
#include <common/state.qh>
#include <lib/csqcmodel/sv_model.qh>
+#include <common/wepent.qh>
.int state;
this.weaponchild.alpha = this.alpha;
this.weaponchild.effects = this.effects;
}
-
- wepent_update(this);
}
void CL_ExteriorWeaponentity_Think(entity this)
{
this.nextthink = time;
.entity weaponentity = this.weaponentity_fld;
- entity wepent = this.owner.(weaponentity);
+ entity w_ent = this.owner.(weaponentity);
if (this.owner.exteriorweaponentity != this)
{
delete(this);
this.model = "";
return;
}
- if (this.weaponname != wepent.weaponname || this.dmg != wepent.modelindex
- || this.deadflag != wepent.deadflag)
+ if (this.weaponname != w_ent.weaponname || this.dmg != w_ent.modelindex
+ || this.deadflag != w_ent.deadflag)
{
- this.weaponname = wepent.weaponname;
- this.dmg = wepent.modelindex;
- this.deadflag = wepent.deadflag;
- if (wepent.weaponname != "")
+ this.weaponname = w_ent.weaponname;
+ this.dmg = w_ent.modelindex;
+ this.deadflag = w_ent.deadflag;
+ if (w_ent.weaponname != "")
{
- _setmodel(this, W_Model(strcat("v_", wepent.weaponname, ".md3")));
+ _setmodel(this, W_Model(strcat("v_", w_ent.weaponname, ".md3")));
setsize(this, '0 0 0', '0 0 0');
}
else this.model = "";
// always keep the Mine Layer if we placed mines, so that we can detonate them
if (thiswep == WEP_MINE_LAYER)
{
- IL_EACH(g_mines, it.owner == actor,
+ IL_EACH(g_mines, it.owner == actor && it.weaponentity_fld == weaponentity,
{
return false;
});
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use, .entity weaponentity)
{
- if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor)) return;
+ if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor, actor.(weaponentity))) return;
if ((actor.items & IT_UNLIMITED_WEAPON_AMMO) && !wep.reloading_ammo) return;