}
}
-#define HITINDICATOR_EXPIRED(i) (time >= HitIndicator_time[i] + autocvar_cl_hit_indicator_fade_time)
+#define HITINDICATOR_EXPIRED(i) (time >= HitIndicator_time[i] + HitIndicator_fade_time)
void HitIndicatorUpdate(float dmg, entity attacker)
{
+ HitIndicator_fade_time = bound(0.1, autocvar_cl_hit_indicator_fade_time, 2);
+
int i = 0;
int first_free_spot = -1;
for (i = 0; i < HITINDICATOR_MAX_COUNT; ++i)
ofs = -ofs;
}
org = scr_center + ofs;
- float alpha = autocvar_cl_hit_indicator_fade_alpha;
- alpha *= 1 - (time - HitIndicator_time[i]) / autocvar_cl_hit_indicator_fade_time;
+ float alpha = bound(0, autocvar_cl_hit_indicator_fade_alpha, 1);
+ alpha *= 1 - (time - HitIndicator_time[i]) / HitIndicator_fade_time;
float size = autocvar_cl_hit_indicator_size;
size = map_bound_ranges(HitIndicator_damage[i], 30, 90, size, size * 2);
drawspritearrow(org, ang, '1 0 0', alpha, size, true);
entity HitIndicator_attacker[HITINDICATOR_MAX_COUNT];
float HitIndicator_damage[HITINDICATOR_MAX_COUNT];
int HitIndicator_time[HITINDICATOR_MAX_COUNT];
+float HitIndicator_fade_time;
void calc_followmodel_ofs(entity view);
seta cl_voice_directional_taunt_attenuation 0.5 "this defines the distance from which taunts can be heard"
seta cl_hit_indicator 1 "show a 2d directional indicator around the screen center when a player hits you"
-seta cl_hit_indicator_fade_time 1.5 "how long hit indicator takes to fade away"
+seta cl_hit_indicator_fade_time 1.5 "how long hit indicator takes to fade away in seconds (max 2 seconds)"
seta cl_hit_indicator_fade_alpha 0.8 "initial hit indicator alpha"
seta cl_hit_indicator_radius 0.15 "show the directional indicator at this percentage of the screen from the center"
seta cl_hit_indicator_size 1.1 "hit indicator size"