// use default physics
set sv_friction_on_land 0
-set sv_player_viewoffset "0 0 42" "view offset of the player model"
+set sv_player_viewoffset "0 0 35" "view offset of the player model"
set sv_player_mins "-16 -16 -24" "playermodel mins"
set sv_player_maxs "16 16 45" "playermodel maxs"
+set sv_player_headsize "24 24 12" "playermodel headshot bbox size (centered at top of player bbox, preview with r_showbboxes)" // actually SHOULD be 19.2 19.2 10 according to docs
set sv_player_crouch_viewoffset "0 0 20" "view offset of the player model when crouched"
set sv_player_crouch_mins "-16 -16 -24" "mins of a crouched playermodel"
set sv_player_crouch_maxs "16 16 25" "maxs of a crouched playermodel"
vector GetHeadshotMins(entity targ)
{
- return '0.6 0 0' * targ.mins_x + '0 0.6 0' * targ.mins_y + '0 0 1' * (1.3 * targ.view_ofs_z - 0.3 * targ.maxs_z);
+ return '-0.5 0 0' * PL_HEAD_x + '0 -0.5 0' * PL_HEAD_y + '0 0 1' * (targ.maxs_z - PL_HEAD_z);
}
vector GetHeadshotMaxs(entity targ)
{
- return '0.6 0 0' * targ.maxs_x + '0 0.6 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
+ return '0.5 0 0' * PL_HEAD_x + '0 0.5 0' * PL_HEAD_y + '0 0 1' * targ.maxs_z;
}
void UpdateFrags(entity player, float f)
vector PL_VIEW_OFS;
vector PL_MIN;
vector PL_MAX;
+vector PL_HEAD;
vector PL_CROUCH_VIEW_OFS;
vector PL_CROUCH_MIN;
vector PL_CROUCH_MAX;
PL_VIEW_OFS = stov(cvar_string("sv_player_viewoffset"));
PL_MIN = stov(cvar_string("sv_player_mins"));
PL_MAX = stov(cvar_string("sv_player_maxs"));
+ PL_HEAD = stov(cvar_string("sv_player_headsize"));
PL_CROUCH_VIEW_OFS = stov(cvar_string("sv_player_crouch_viewoffset"));
PL_CROUCH_MIN = stov(cvar_string("sv_player_crouch_mins"));
PL_CROUCH_MAX = stov(cvar_string("sv_player_crouch_maxs"));