]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Limit fading out of centerprints to 1 second, otherwise it can be accidentally set...
authorSamual <samual@xonotic.org>
Tue, 18 Oct 2011 23:20:09 +0000 (19:20 -0400)
committerSamual <samual@xonotic.org>
Tue, 18 Oct 2011 23:20:09 +0000 (19:20 -0400)
qcsrc/client/hud.qc

index 48568de96ab1169698a16934b04d0dc173536b63..17fe52a388fa5863c6fac44f32b8d2a3b05b3e20 100644 (file)
@@ -4522,9 +4522,9 @@ void centerprint_generic(float new_id, string strMessage, float duration, float
                        if (strMessage == "" && centerprint_messages[j] != "" && centerprint_countdown_num[j] == 0)
                        {
                                // fade out the current msg (duration and countdown_num are ignored)
-                               centerprint_time[j] = autocvar_hud_panel_centerprint_fade_out;
-                               if (centerprint_expire_time[j] > time + autocvar_hud_panel_centerprint_fade_out || centerprint_expire_time[j] < time)
-                                       centerprint_expire_time[j] = time + autocvar_hud_panel_centerprint_fade_out;
+                               centerprint_time[j] = min(1, autocvar_hud_panel_centerprint_fade_out);
+                               if (centerprint_expire_time[j] > time + min(1, autocvar_hud_panel_centerprint_fade_out) || centerprint_expire_time[j] < time)
+                                       centerprint_expire_time[j] = time + min(1, autocvar_hud_panel_centerprint_fade_out);
                                return;
                        }
                        break; // found a msg with the same id, at position j