{
// fade out the current msg (duration and countdown_num are ignored)
centerprint_time[j] = min(5, autocvar_hud_panel_centerprint_fade_out);
- if (centerprint_expire_time[j] > time + min(5, autocvar_hud_panel_centerprint_fade_out) || centerprint_expire_time[j] < time)
- centerprint_expire_time[j] = time + min(5, autocvar_hud_panel_centerprint_fade_out);
+ centerprint_expire_time[j] = -1; // don't use the variable time here!
return;
}
break; // found a msg with the same id, at position j
if (duration < 0)
{
centerprint_time[j] = -1;
- centerprint_expire_time[j] = time;
+ centerprint_expire_time[j] = -1; // don't use the variable time here!
}
else
{
if(duration == 0)
duration = max(1, autocvar_hud_panel_centerprint_time);
centerprint_time[j] = duration;
- centerprint_expire_time[j] = time + duration;
+ centerprint_expire_time[j] = -1; // don't use the variable time here!
}
centerprint_countdown_num[j] = countdown_num;
}
{
if (j == CENTERPRINT_MAX_MSGS)
j = 0;
+ if (centerprint_expire_time[j] == -1)
+ {
+ // here we are sure the time variable is not altered by CSQC_Ent_Update
+ centerprint_expire_time[j] = time;
+ if (centerprint_time[j] > 0)
+ centerprint_expire_time[j] += centerprint_time[j];
+ }
if (centerprint_expire_time[j] <= time)
{
if (centerprint_countdown_num[j] && centerprint_time[j] > 0)