" ", ftos(tstart), " ", ftos(dt), "\n"));
}
-vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter, float algn)
-{
- switch(algn)
- {
- default:
- case 3: // right
- break;
-
- case 4: // left
- vecs.y = -vecs.y;
- break;
-
- case 1:
- if(allowcenter) // 2: allow center handedness
- {
- // center
- vecs.y = 0;
- vecs.z -= 2;
- }
- else
- {
- // right
- }
- break;
-
- case 2:
- if(allowcenter) // 2: allow center handedness
- {
- // center
- vecs.y = 0;
- vecs.z -= 2;
- }
- else
- {
- // left
- vecs.y = -vecs.y;
- }
- break;
- }
- return vecs;
-}
-
-vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn)
-{
- string s;
- vector v;
-
- if (autocvar_g_shootfromeye)
- {
- if (visual)
- {
- if (autocvar_g_shootfromclient) { vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn); }
- else { vecs.y = 0; vecs.z -= 2; }
- }
- else
- {
- vecs.y = 0;
- vecs.z = 0;
- }
- }
- else if (autocvar_g_shootfromcenter)
- {
- vecs.y = 0;
- vecs.z -= 2;
- }
- else if ((s = autocvar_g_shootfromfixedorigin) != "")
- {
- v = stov(s);
- if (y_is_right)
- v.y = -v.y;
- if (v.x != 0)
- vecs.x = v.x;
- vecs.y = v.y;
- vecs.z = v.z;
- }
- else if (autocvar_g_shootfromclient)
- {
- vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn);
- }
- return vecs;
-}
-
-vector shotorg_adjust(vector vecs, float y_is_right, float visual)
-{SELFPARAM();
- return shotorg_adjust_values(vecs, y_is_right, visual, self.owner.cvar_cl_gunalign);
-}
-
-
void attach_sameorigin(entity e, entity to, string tag)
{
vector org, t_forward, t_left, t_up, e_forward, e_up;