" ", 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;
-
- if(visual)
- vecs = shotorg_adjustfromclient(vecs, y_is_right, true, algn);
- else if(autocvar_g_shootfromeye)
- vecs.y = vecs.z = 0;
- else if(autocvar_g_shootfromcenter)
- {
- vecs.y = 0;
- vecs.z -= 2;
- }
- else if((s = autocvar_g_shootfromfixedorigin) != "")
- {
- vector 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;
- }
-
- 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;
void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten);
float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d);
-vector shotorg_adjust(vector vecs, float y_is_right, float visual);
-
float DistributeEvenly_amount;
float DistributeEvenly_totalweight;
void objerror(string s);
void SetMovetypeFollow(entity ent, entity e);
-vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn);
-
void soundto(float dest, entity e, float chan, string samp, float vol, float atten);
void stopsound(entity e, float chan);
#include "../../common/weapons/all.qh"
#include "../../lib/csqcmodel/sv_model.qh"
-/*
-===========================================================================
+vector shotorg_adjustfromclient(vector vecs, float y_is_right, float algn)
+{
+ switch(algn)
+ {
+ default: case 3: break; // right alignment
+ case 4: vecs.y = -vecs.y; break; // left
+ case 1: case 2: vecs.y = 0; vecs.z -= 2; break; // center
+ }
+
+ return vecs;
+}
+
+vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn)
+{
+ string s;
- CLIENT WEAPONSYSTEM CODE
- Bring back W_Weaponframe
+ if(visual)
+ vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
+ else if(autocvar_g_shootfromeye)
+ vecs.y = vecs.z = 0;
+ else if(autocvar_g_shootfromcenter)
+ {
+ vecs.y = 0;
+ vecs.z -= 2;
+ }
+ else if((s = autocvar_g_shootfromfixedorigin) != "")
+ {
+ vector 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 // just do the same as top
+ vecs = shotorg_adjustfromclient(vecs, y_is_right, 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);
+}
.int state;
const float WFRAME_IDLE = 2;
const float WFRAME_RELOAD = 3;
+vector shotorg_adjust(vector vecs, float y_is_right, float visual);
+
+vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn);
+
void CL_SpawnWeaponentity(entity e);
vector CL_Weapon_GetShotOrg(float wpn);