X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fshockwave.qc;h=01a922bb8e47a7c6a80236062a04d902d7239738;hb=0514f7948727cfa572b33bd29d1bdf2c13cd866d;hp=cdd0a0f92a315ecf1b3e774aa21b93ea17a5edfb;hpb=45d8904a100765555e622598a39967963733df1d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index cdd0a0f92a..01a922bb8e 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -3,6 +3,8 @@ REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE) #ifdef SVQC +// enable when shockwave replaces shotgun +#if 0 METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e)) { //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO @@ -12,6 +14,7 @@ METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e)) } return this; } +#endif const float MAX_SHOCKWAVE_HITS = 10; //#define DEBUG_SHOCKWAVE @@ -476,7 +479,7 @@ void W_Shockwave_Attack(Weapon thiswep, entity actor, .entity weaponentity) // BLAST CONE CALCULATION // ======================== - // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc) + // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in damage.qc) center = CENTER_OR_VIEWOFS(head); // find the closest point on the enemy to the center of the attack @@ -663,9 +666,8 @@ void Draw_Shockwave(entity this) // WEAPONTODO: trace to find what we actually hit vector endpos = (this.sw_shotorg + (this.sw_shotdir * this.sw_distance)); - vectorvectors(this.sw_shotdir); - vector right = v_right; // save this for when we do makevectors later - vector up = v_up; // save this for when we do makevectors later + vector _forward, right, up; + VECTOR_VECTORS(this.sw_shotdir, _forward, right, up); // WEAPONTODO: combine and simplify these calculations vector min_end = ((this.sw_shotorg + (this.sw_shotdir * SW_DISTTOMIN)) + (up * this.sw_spread_min)); @@ -710,14 +712,14 @@ void Draw_Shockwave(entity this) if(counter >= 1) { // draw from shot origin to min spread radius - R_BeginPolygon("", DRAWFLAG_NORMAL); + R_BeginPolygon("", DRAWFLAG_NORMAL, false); R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a); R_PolygonVertex(new_min_end, '0 0 0', sw_color, a); R_PolygonVertex(this.sw_shotorg, '0 0 0', sw_color, a); R_EndPolygon(); // draw from min spread radius to max spread radius - R_BeginPolygon("", DRAWFLAG_NORMAL); + R_BeginPolygon("", DRAWFLAG_NORMAL, false); R_PolygonVertex(new_min_end, '0 0 0', sw_color, a); R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a); R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a); @@ -732,14 +734,14 @@ void Draw_Shockwave(entity this) if((counter + 1) == divisions) { // draw from shot origin to min spread radius - R_BeginPolygon("", DRAWFLAG_NORMAL); + R_BeginPolygon("", DRAWFLAG_NORMAL, false); R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a); R_PolygonVertex(first_min_end, '0 0 0', sw_color, a); R_PolygonVertex(this.sw_shotorg, '0 0 0', sw_color, a); R_EndPolygon(); // draw from min spread radius to max spread radius - R_BeginPolygon("", DRAWFLAG_NORMAL); + R_BeginPolygon("", DRAWFLAG_NORMAL, false); R_PolygonVertex(first_min_end, '0 0 0', sw_color, a); R_PolygonVertex(prev_min_end, '0 0 0', sw_color, a); R_PolygonVertex(prev_max_end, '0 0 0', sw_color, a); @@ -757,8 +759,7 @@ NET_HANDLE(TE_CSQC_SHOCKWAVEPARTICLE, bool isNew) void Net_ReadShockwaveParticle() { - entity shockwave; - shockwave = spawn(); + entity shockwave = new(shockwave_cone); shockwave.draw = Draw_Shockwave; IL_PUSH(g_drawables, shockwave);