X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qc;h=70937716490921edcd0e01e07b889bf97ab565e0;hb=133cba402a7d11565c47dc42412b2ac0b9b8f121;hp=07c51f18ddcf7853c19538d3f3784aaf959e1bb4;hpb=83aa41f3c3059b7987a0310feb6cb64fa81ee6fb;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 07c51f18d..709377164 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -378,6 +378,7 @@ vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn * this.origin, this.angles * this.weaponchild * this.movedir, this.view_ofs, this.movedir_aligned + * this.spawnorigin (SVQC only) * attachment stuff * anim stuff * to free: @@ -394,7 +395,9 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim) if (this.weaponchild) delete(this.weaponchild); this.weaponchild = NULL; this.movedir = '0 0 0'; +#ifdef SVQC this.spawnorigin = '0 0 0'; +#endif this.oldorigin = '0 0 0'; this.anim_fire1 = '0 1 0.01'; this.anim_fire2 = '0 1 0.01'; @@ -466,6 +469,7 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim) this.movedir = '0 0 0'; } } +#ifdef SVQC { int idx = 0; // v_ model attached to invisible h_ model @@ -485,6 +489,7 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim) this.spawnorigin = this.movedir; } } +#endif if (v_shot_idx) { this.oldorigin = '0 0 0'; // use regular attachment @@ -531,7 +536,7 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim) vector v = this.movedir; this.movedir = shotorg_adjust(v, false, false, algn); this.movedir_aligned = shotorg_adjust(v, false, true, algn); - this.view_ofs = shotorg_adjust(v, false, true, algn) - v; + this.view_ofs = this.movedir_aligned - v; } int compressed_shotorg = compressShotOrigin(this.movedir); // make them match perfectly @@ -541,7 +546,9 @@ void CL_WeaponEntity_SetModel(entity this, string name, bool _anim) #endif this.movedir = decompressShotOrigin(compressed_shotorg); +#ifdef SVQC this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount +#endif // check if an instant weapon switch occurred setorigin(this, this.view_ofs);