SHOCKWAVE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
#endif
#ifdef CSQC
-void Net_ReadShockwaveParticle(void);
+void Net_ReadShockwaveParticle();
.vector sw_shotorg;
.vector sw_shotdir;
.float sw_distance;
#endif
#endif
#ifdef IMPLEMENTATION
+
+REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
+
#ifdef SVQC
spawnfunc(weapon_shockwave)
{
vector shockwave_hit_force[MAX_SHOCKWAVE_HITS];
// MELEE ATTACK MODE
-void W_Shockwave_Melee_Think(void)
+void W_Shockwave_Melee_Think()
{SELFPARAM();
// declarations
float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
}
}
-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 = new(meleetemp);
make_pure(meleetemp);
return true;
}
-void W_Shockwave_Send(void)
+void W_Shockwave_Send()
{SELFPARAM();
- WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
+ WriteHeader(MSG_BROADCAST, TE_CSQC_SHOCKWAVEPARTICLE);
WriteCoord(MSG_BROADCAST, w_shotorg.x);
WriteCoord(MSG_BROADCAST, w_shotorg.y);
WriteCoord(MSG_BROADCAST, w_shotorg.z);
WriteByte(MSG_BROADCAST, num_for_edict(self));
}
-void W_Shockwave_Attack(void)
+void W_Shockwave_Attack()
{SELFPARAM();
// declarations
float multiplier, multiplier_from_accuracy, multiplier_from_distance;
else
{ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
}
- METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, int slot, int fire))
+ METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
if(fire & 1)
{
if(time >= actor.shockwave_blasttime) // handle refire separately so the secondary can be fired straight after a primary
{
- if(weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR(shockwave, blast_animtime)))
+ if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(shockwave, blast_animtime)))
{
W_Shockwave_Attack();
actor.shockwave_blasttime = time + WEP_CVAR(shockwave, blast_refire) * W_WeaponRateFactor();
- weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(shockwave, blast_animtime), w_ready);
}
}
}
{
//if(actor.clip_load >= 0) // we are not currently reloading
if(!actor.crouch) // no crouchmelee please
- if(weapon_prepareattack(thiswep, actor, slot, true, WEP_CVAR(shockwave, melee_refire)))
+ if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR(shockwave, melee_refire)))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
- weapon_thinkf(actor, slot, WFRAME_FIRE1, 0, W_Shockwave_Melee);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, W_Shockwave_Melee);
}
}
}
}
}
-void Net_ReadShockwaveParticle(void)
+NET_HANDLE(TE_CSQC_SHOCKWAVEPARTICLE, bool isNew)
+{
+ Net_ReadShockwaveParticle();
+ return true;
+}
+
+void Net_ReadShockwaveParticle()
{
entity shockwave;
shockwave = spawn();