set g_lms_leader_wp_lives 2 "show waypoints for players leading by this number of lives"
set g_lms_leader_wp_max_relative 0.5 "show waypoints for leaders only if they are max this fraction of total players"
set g_lms_leader_wp_time 5 "show waypoints for leaders only for this amount of time"
-set g_lms_leader_wp_time_repeat 30 "periodically show again waypoints for leaders after this amount of time"
+set g_lms_leader_wp_time_jitter 10 "jitter waypoint repeat time by this amount of time"
+set g_lms_leader_wp_time_repeat 25 "periodically show again waypoints for leaders after this amount of time"
set g_lms_dynamic_respawn_delay 1 "increase player respawn delay based on the number of lives less than the leader (NOTE: delay doesn't increase when only 2 players are left alive)"
set g_lms_dynamic_respawn_delay_base 2 "base player respawn delay"
set g_lms_dynamic_respawn_delay_increase 3 "increase base player respawn delay by this amount of time for each life less than the leader"
int autocvar_g_lms_leader_wp_lives = 2;
float autocvar_g_lms_leader_wp_max_relative = 0.5;
float autocvar_g_lms_leader_wp_time = 5;
-float autocvar_g_lms_leader_wp_time_repeat = 30;
+float autocvar_g_lms_leader_wp_time_jitter = 10;
+float autocvar_g_lms_leader_wp_time_repeat = 25;
float autocvar_g_lms_dynamic_respawn_delay = 1;
float autocvar_g_lms_dynamic_respawn_delay_base = 2;
float autocvar_g_lms_dynamic_respawn_delay_increase = 3;
int lms_leaders;
bool lms_visible_leaders;
bool lms_visible_leaders_prev;
+float lms_leader_time_jitter;
// main functions
int LMS_NewPlayerLives()
float leader_repeat_time = leader_time + autocvar_g_lms_leader_wp_time_repeat;
lms_visible_leaders_prev = lms_visible_leaders;
lms_visible_leaders = (time % leader_repeat_time < leader_time);
+ if (lms_visible_leaders_prev && !lms_visible_leaders)
+ lms_leader_time_jitter = random() * autocvar_g_lms_leader_wp_time_jitter;
+ leader_repeat_time += lms_leader_time_jitter;
lms_leaders = 0;
FOREACH_CLIENT(true, {