X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fshockwave.qc;h=b795cb7e9f393559e6d2d02a9226bafecebc4c18;hb=1cbef966e133966c5b5f0f5b58fbd1a5851ed35b;hp=8d2edb81464334a4daaf7c7bd15bf82a5beecca8;hpb=b683bf23a495d3b1b3f6df3bda75bfe0f069ab05;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 8d2edb814..b795cb7e9 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -73,7 +73,7 @@ REGISTER_WEAPON(SHOCKWAVE, NEW(Shockwave)); 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; @@ -83,6 +83,9 @@ void Net_ReadShockwaveParticle(void); #endif #endif #ifdef IMPLEMENTATION + +REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE) + #ifdef SVQC spawnfunc(weapon_shockwave) { @@ -107,7 +110,7 @@ float shockwave_hit_damage[MAX_SHOCKWAVE_HITS]; 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; @@ -229,10 +232,10 @@ void W_Shockwave_Melee_Think(void) } } -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); @@ -335,10 +338,9 @@ float W_Shockwave_Attack_CheckHit( 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); @@ -351,7 +353,7 @@ void W_Shockwave_Send(void) 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; @@ -675,17 +677,17 @@ void W_Shockwave_Attack(void) 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); } } } @@ -693,10 +695,10 @@ void W_Shockwave_Attack(void) { //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); } } } @@ -833,7 +835,13 @@ void Draw_Shockwave(entity this) } } -void Net_ReadShockwaveParticle(void) +NET_HANDLE(TE_CSQC_SHOCKWAVEPARTICLE, bool isNew) +{ + Net_ReadShockwaveParticle(); + return true; +} + +void Net_ReadShockwaveParticle() { entity shockwave; shockwave = spawn();