- 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
+ }