X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fweapons%2Fprojectile.qc;h=5132b4998916f9e9a60f6bb86c6523560b0e2149;hp=3fe6deb78fb77c8c98c9bd33bc27eb9e7c2e37d6;hb=4e21f418ad9e6287efb942c1fa2861a51981110a;hpb=5d43c54fb54232bcfd81f24876d2f1a82308c909 diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 3fe6deb78..5132b4998 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -88,17 +88,14 @@ void Projectile_Draw(entity this) drawn = (this.iflags & IFLAG_VALID); t = time; } + bool is_nade = Projectile_isnade(this.cnt); if (!(f & FL_ONGROUND)) { rot = '0 0 0'; - switch (this.cnt) + if (is_nade) rot = this.avelocity; + else switch (this.cnt) { - /* - case PROJECTILE_GRENADE: - rot = '-2000 0 0'; // forward - break; - */ case PROJECTILE_GRENADE_BOUNCING: rot = '0 -1000 0'; // sideways break; @@ -108,41 +105,45 @@ void Projectile_Draw(entity this) case PROJECTILE_ROCKET: rot = '0 0 720'; // spinning break; - default: - break; } - if (Projectile_isnade(this.cnt)) - rot = this.avelocity; - - this.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(this.angles), rot * (t - this.spawntime))); + if (rot) + { + if (!rot.x && !rot.y) + { + // cheaper z-only rotation formula + this.angles.z = (rot.z * (t - this.spawntime)) % 360; + if (this.angles.z < 0) + this.angles.z += 360; + } + else + this.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(this.angles), rot * (t - this.spawntime))); + } } - vector ang; - ang = this.angles; - ang.x = -ang.x; - makevectors(ang); - a = 1 - (time - this.fade_time) * this.fade_rate; this.alpha = bound(0, this.alphamod * a, 1); if (this.alpha <= 0) drawn = 0; this.renderflags = 0; + vector ang = this.angles; + ang.x = -ang.x; trailorigin = this.origin; - switch (this.cnt) + if (is_nade) + { + makevectors(ang); + trailorigin += v_up * 4; + } + else switch (this.cnt) { case PROJECTILE_GRENADE: case PROJECTILE_GRENADE_BOUNCING: + makevectors(ang); trailorigin += v_right * 1 + v_forward * -10; break; - default: - break; } - if (Projectile_isnade(this.cnt)) - trailorigin += v_up * 4; - if (drawn) Projectile_DrawTrail(this, trailorigin); else @@ -302,7 +303,7 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) HANDLE(GRENADE_BOUNCING) this.traileffect = EFFECT_TR_GRENADE.m_id; break; HANDLE(MINE) this.traileffect = EFFECT_TR_GRENADE.m_id; break; HANDLE(BLASTER) this.traileffect = EFFECT_Null.m_id; break; - HANDLE(ARC_BOLT) this.traileffect = EFFECT_Null.m_id; break; + HANDLE(ARC_BOLT) this.traileffect = EFFECT_TR_WIZSPIKE.m_id; break; HANDLE(HLAC) this.traileffect = EFFECT_Null.m_id; break; HANDLE(PORTO_RED) this.traileffect = EFFECT_TR_WIZSPIKE.m_id; this.scale = 4; break; HANDLE(PORTO_BLUE) this.traileffect = EFFECT_TR_WIZSPIKE.m_id; this.scale = 4; break; @@ -433,6 +434,10 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) this.mins = '-4 -4 -4'; this.maxs = '4 4 4'; break; + case PROJECTILE_ARC_BOLT: + set_movetype(this, MOVETYPE_BOUNCE); + settouch(this, func_null); + break; case PROJECTILE_RAPTORBOMB: this.mins = '-3 -3 -3'; this.maxs = '3 3 3';