X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fprojectile.qc;h=9a773379b5d6eed97a57ae1189f2651ffc6c67d8;hp=b67cc76aadc206c591f8f1f3f249ecc394f9af6b;hb=061a422c134fb7d2180bc32879abb80a302ea284;hpb=715202f719f244160bfc0b004013fa6e1bcc5668 diff --git a/qcsrc/client/projectile.qc b/qcsrc/client/projectile.qc index b67cc76aad..9a773379b5 100644 --- a/qcsrc/client/projectile.qc +++ b/qcsrc/client/projectile.qc @@ -22,6 +22,11 @@ void SUB_Stop() .float silent; .float traileffect; +void Projectile_ResetTrail(vector to) +{ + self.trail_oldorigin = to; + self.trail_oldtime = time; +} void Projectile_DrawTrail(vector to) { vector from; @@ -38,20 +43,8 @@ void Projectile_DrawTrail(vector to) if (self.traileffect) { - if(checkextension("DP_CSQC_BOXPARTICLES")) - { - /* looks good, but we can do better with particle count - particles_alphamin = particles_alphamax = self.alpha; - boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA); - */ - /* looks bad - boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, self.alpha, 0); - */ - particles_alphamin = particles_alphamax = sqrt(self.alpha); - boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, sqrt(self.alpha), PARTICLES_USEALPHA); - } - else - trailparticles(self, self.traileffect, from, to); + particles_alphamin = particles_alphamax = sqrt(self.alpha); + boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, sqrt(self.alpha), PARTICLES_USEALPHA); } } @@ -69,9 +62,18 @@ void Projectile_Draw() if(self.count & 0x80) { //self.move_flags &~= FL_ONGROUND; - Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); + if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY) + Movetype_Physics_NoMatchServer(); + // the trivial movetypes do not have to match the + // server's ticrate as they are ticrate independent + // NOTE: this assumption is only true if MOVETYPE_FLY + // projectiles detonate on impact. If they continue + // moving, we might still be ticrate dependent. + else + Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); if(!(self.move_flags & FL_ONGROUND)) - self.angles = vectoangles(self.velocity); + if(self.velocity != '0 0 0') + self.angles = vectoangles(self.velocity); } else { @@ -135,10 +137,7 @@ void Projectile_Draw() if(drawn) Projectile_DrawTrail(trailorigin); else - { - self.trail_oldorigin = trailorigin; - self.trail_oldtime = time; - } + Projectile_ResetTrail(trailorigin); if(!drawn) return; @@ -309,8 +308,8 @@ void Ent_Projectile() case PROJECTILE_ELECTRO: // only new engines support sound moving with object loopsound(self, CHAN_PROJECTILE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM); - self.mins = '0 0 -3'; - self.maxs = '0 0 -3'; + self.mins = '0 0 -4'; + self.maxs = '0 0 -4'; self.move_movetype = MOVETYPE_BOUNCE; self.move_touch = SUB_Null; break; @@ -320,12 +319,12 @@ void Ent_Projectile() self.maxs = '3 3 3'; break; case PROJECTILE_GRENADE: - self.mins = '0 0 -3'; - self.maxs = '0 0 -3'; + self.mins = '-3 -3 -3'; + self.maxs = '3 3 3'; break; case PROJECTILE_GRENADE_BOUNCING: - self.mins = '0 0 -3'; - self.maxs = '0 0 -3'; + self.mins = '-3 -3 -3'; + self.maxs = '3 3 3'; self.move_movetype = MOVETYPE_BOUNCE; self.move_touch = SUB_Null; self.move_bounce_factor = g_balance_grenadelauncher_secondary_bouncefactor;