}
}
- void W_Shockwave_Melee(Weapon thiswep, entity actor, int slot, int fire)
+ void W_Shockwave_Melee(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTN_NORM);
- weapon_thinkf(actor, slot, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
- entity meleetemp;
- meleetemp = spawn();
+ entity meleetemp = new(meleetemp);
+ make_pure(meleetemp);
meleetemp.owner = meleetemp.realowner = actor;
meleetemp.think = W_Shockwave_Melee_Think;
meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor();
}
}
- void W_Shotgun_Attack2(Weapon thiswep, entity actor, int slot, int fire)
+ void W_Shotgun_Attack2(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTEN_NORM);
- weapon_thinkf(actor, slot, WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
- entity meleetemp;
- meleetemp = spawn();
+ entity meleetemp = new(meleetemp);
+ make_pure(meleetemp);
meleetemp.realowner = actor;
meleetemp.think = W_Shotgun_Melee_Think;
meleetemp.nextthink = time + WEP_CVAR_SEC(shotgun, melee_delay) * W_WeaponRateFactor();
}
// spawning weaponentity for client
- void CL_SpawnWeaponentity(entity e, int slot)
+ void CL_SpawnWeaponentity(entity e, .entity weaponentity)
{
- entity view = e.weaponentity[slot] = new(weaponentity);
+ entity view = e.(weaponentity) = new(weaponentity);
+ make_pure(view);
view.solid = SOLID_NOT;
view.owner = e;
setmodel(view, MDL_Null); // precision set when changed
view.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
view.nextthink = time;
- if (slot == 0)
+ if (weaponentity == weaponentities[0])
{
- entity exterior = e.exteriorweaponentity = spawn();
- exterior.classname = "exteriorweaponentity";
+ entity exterior = e.exteriorweaponentity = new(exteriorweaponentity);
+ make_pure(exterior);
exterior.solid = SOLID_NOT;
exterior.exteriorweaponentity = exterior;
exterior.owner = e;