this.movedir_aligned = shotorg_adjust(v, false, true, algn);
this.view_ofs = this.movedir_aligned - v;
}
- int compressed_shotorg = compressShotOrigin(this.movedir);
- // make them match perfectly
-#ifdef SVQC
- // null during init
- if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
-#endif
- this.movedir = decompressShotOrigin(compressed_shotorg);
+
+ // shotorg_adjust can give negative .x from shootfromfixedorigin
+ // recheck .x here due to it
+ if (this.movedir.x >= 0)
+ {
+ int compressed_shotorg = compressShotOrigin(this.movedir);
+ // make them match perfectly
+ #ifdef SVQC
+ // null during init
+ if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
+ #endif
+ this.movedir = decompressShotOrigin(compressed_shotorg);
+ }
+ else
+ {
+ // don't support negative x shotorgs
+ this.movedir = '0 0 0';
+
+ // reset _aligned here too even though as a side effect
+ // g_shootfromfixedorigin can make it reset
+ // it'd be only slightly better if it was checked individually
+ this.movedir_aligned = '0 0 0';
+
+ #ifdef SVQC
+ // null during init
+ if (this.owner) STAT(SHOTORG, this.owner) = 0;
+ #endif
+ }
#ifdef SVQC
this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount
rlplayer = csqcplayer; // fall back to the global
vector md = wepent.movedir_aligned;
- vector vecs = ((md.x > 0) ? md : '0 0 0');
- vector dv = forward * vecs.x + right * -vecs.y + up * vecs.z;
+ vector dv = forward * md.x + right * -md.y + up * md.z;
vector org = rlplayer.origin + rlplayer.view_ofs + dv;
pointparticles(thiswep.m_muzzleeffect, org, forward * 1000, 1);