set g_running_guns 0 "... or wonder, till it drives you mad, what would have followed if you had."
set g_bastet 0 "don't try"
-set g_loituma 0 "no, really"
set _urllib_nextslot 0 "temp variable"
set cl_warpzone_usetrace 1 "do not touch"
seta cl_noantilag 0 "turn this on if you believe antilag is bad"
-set sv_pitch_min -35 "minimum aiming angle for shooting direction display of the gun"
-set sv_pitch_max 35 "maximum aiming angle for shooting direction display of the gun"
-set sv_pitch_fixyaw 0 "workaround to fix the aiming direction on stupidly made player models, FIXME fix the models and set this to 0"
-
set rescan_pending 0 "set to 1 to schedule a fs_rescan at the end of this match"
set g_mapinfo_allow_unsupported_modes_and_let_stuff_break "0" "set to 1 to be able to force game types using g_ cvars even if the map does not support them"
e.bone_weapon = gettagindex(e, "tag_weapon");
if(!e.bone_weapon)
e.bone_weapon = gettagindex(e, "bip01 r hand");
+ e.bone_aim = 0;
e.fixbone = 0;
if(get_model_parameters(e.model, e.skin))
{
e.bone_upperbody = gettagindex(e, get_model_parameters_bone_upperbody);
if(get_model_parameters_bone_weapon)
e.bone_weapon = gettagindex(e, get_model_parameters_bone_weapon);
- e.fixbone = get_model_parameters_fixbone;
+ if(get_model_parameters_bone_aim)
+ e.bone_aim = gettagindex(e, get_model_parameters_bone_aim);
+ if(e.bone_upperbody)
+ e.fixbone = get_model_parameters_fixbone;
}
else
dprint("No model parameters for ", e.model, "\n");
// FIX IT
skeleton_fixbone(e, fixbone_oldangles);
}
+
+ if(e.bone_aim)
+ {
+ vector aim = '-1 0 0' * self.v_angle_x;
+
+ skel_get_boneabs(s, e.bone_aim);
+ vector ang_cur = fixedvectoangles2(v_forward, v_up);
+ vector ang = AnglesTransform_Multiply(aim, ang_cur);
+ vector fix = AnglesTransform_LeftDivide(ang_cur, ang);
+ fixedmakevectors(fix);
+ skel_mul_bone(s, e.bone_aim, '0 0 0');
+
+ }
}
.float bone_upperbody;
.float bone_weapon;
+.float bone_aim;
.float fixbone;
CSQCMODEL_ENDIF \
CSQCMODEL_PROPERTY(512, float, ReadChar, WriteChar, anim_upper_action) \
CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
+ CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
CSQCMODEL_ENDIF
// TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
get_model_parameters_desc = string_null;
get_model_parameters_bone_upperbody = string_null;
get_model_parameters_bone_weapon = string_null;
+ get_model_parameters_bone_aim = string_null;
get_model_parameters_fixbone = 0;
if not(m)
get_model_parameters_bone_upperbody = s;
if(c == "bone_weapon")
get_model_parameters_bone_weapon = s;
+ if(c == "bone_aim")
+ get_model_parameters_bone_aim = s;
if(c == "fixbone")
get_model_parameters_fixbone = stof(s);
}
float get_model_parameters_age;
string get_model_parameters_bone_upperbody;
string get_model_parameters_bone_weapon;
+string get_model_parameters_bone_aim;
float get_model_parameters_fixbone;
string get_model_parameters_desc;
float get_model_parameters(string mod, float skn); // call with string_null to clear; skin -1 means mod is the filename of the txt file and is to be split
float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
float autocvar_g_trueaim_minrange;
float autocvar_g_debug_defaultsounds;
-float autocvar_g_loituma;
float autocvar_g_grab_range;
float autocvar_g_sandbox_info;
float autocvar_g_sandbox_readonly;
void CL_ExteriorWeaponentity_Think()
{
float tag_found;
- vector ang;
self.nextthink = time;
if (self.owner.exteriorweaponentity != self)
{
setattachment(self, self.owner, "bip01 r hand");
}
self.effects = self.owner.effects;
- if(sv_pitch_min == sv_pitch_max)
- self.effects |= EF_LOWPRECISION;
- else
- self.effects &~= EF_LOWPRECISION;
+ self.effects |= EF_LOWPRECISION;
self.effects = self.effects & EFMASK_CHEAP; // eat performance
if(self.owner.alpha == default_player_alpha)
self.alpha = default_weapon_alpha;
else
self.alpha = 1;
- if (!intermission_running)
- {
- ang_x = bound(sv_pitch_min, self.owner.v_angle_x, sv_pitch_max);
- ang_y = 0;
- ang_z = 0;
-
- if(sv_pitch_fixyaw) // workaround for stupid player models that don't aim forward
- {
- ang_y = self.owner.v_angle_y;
- makevectors(ang);
- var vector v = v_forward;
- var float t = self.tag_entity.frame1time;
- var float f = self.tag_entity.frame;
- self.tag_entity.frame1time = time;
- self.tag_entity.frame = self.tag_entity.anim_idle_x;
- gettaginfo(self.tag_entity, self.tag_index);
- self.tag_entity.frame1time = t;
- self.tag_entity.frame = f;
- // untransform v according to this coordinate space
- vector w;
- w_x = v_forward * v;
- w_y = -v_right * v;
- w_z = v_up * v;
- self.angles = vectoangles(w);
- }
- else
- {
- ang_x = -/* don't ask */ang_x;
- self.angles = ang;
- }
-
- if(autocvar_g_loituma)
- {
- vector modangles;
- float t;
-
- t = time * autocvar_g_loituma;
-
- modangles_x = t * 360;
- modangles_y = 90;
- modangles_z = 0;
-
- self.angles =
- AnglesTransform_ToAngles(
- AnglesTransform_Multiply(
- AnglesTransform_FromAngles(self.angles),
- AnglesTransform_FromAngles(modangles)
- )
- );
- }
- }
-
self.glowmod = self.owner.weaponentity_glowmod;
self.colormap = self.owner.colormap;
float sv_autotaunt;
float sv_taunt;
-float sv_pitch_min;
-float sv_pitch_max;
-float sv_pitch_fixyaw;
-
string GetGametype(); // g_world.qc
void readlevelcvars(void)
{
if not(inWarmupStage && !g_ca)
game_starttime = cvar("g_start_delay");
- sv_pitch_min = cvar("sv_pitch_min");
- sv_pitch_max = cvar("sv_pitch_max");
- sv_pitch_fixyaw = cvar("sv_pitch_fixyaw");
-
readplayerstartcvars();
}