]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix terencehill's variable abuse. Unbreaks centerprint.
authorRudolf Polzer <divverent@xonotic.org>
Wed, 1 Jan 2014 09:37:49 +0000 (10:37 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 1 Jan 2014 09:37:49 +0000 (10:37 +0100)
WHY DID I LET THIS GO WHEN REVIEWING THIS STUFF.

qcsrc/client/hud.qc

index 0bc5ed0f80beb412cd563cd10901abc266ddb116..8bb221f60df2ea91dce1dfa777f3ca060ad03d42 100644 (file)
@@ -4261,8 +4261,7 @@ void HUD_CenterPrint (void)
        float a, sz, align, current_msg_pos_y = 0, msg_size;
        vector pos;
        string ts;
        float a, sz, align, current_msg_pos_y = 0, msg_size;
        vector pos;
        string ts;
-
-       n = -1; // if no msg will be displayed, n stays -1
+       float all_messages_expired = TRUE;
 
        pos = panel_pos;
        if (autocvar_hud_panel_centerprint_flip)
 
        pos = panel_pos;
        if (autocvar_hud_panel_centerprint_flip)
@@ -4285,6 +4284,7 @@ void HUD_CenterPrint (void)
                                continue;
                }
 
                                continue;
                }
 
+               all_messages_expired = FALSE;
 
                // fade the centerprint_hud in/out
                if(centerprint_time[j] < 0)  // Expired but forced. Expire time is the fade-in time.
 
                // fade the centerprint_hud in/out
                if(centerprint_time[j] < 0)  // Expired but forced. Expire time is the fade-in time.
@@ -4294,7 +4294,7 @@ void HUD_CenterPrint (void)
                else // Expiring soon, so fade it out.
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
 
                else // Expiring soon, so fade it out.
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
 
-               if (a <= 0.5/256.0)  // Guaranteed invisible - don't show.
+               if (a <= 0.5/255.0)  // Guaranteed invisible - don't show.
                        continue;
                if (a > 1)
                        a = 1;
                        continue;
                if (a > 1)
                        a = 1;
@@ -4348,7 +4348,7 @@ void HUD_CenterPrint (void)
                                {
                                        if (align)
                                                pos_x = panel_pos_x + (panel_size_x - stringwidth(ts, TRUE, fontsize)) * align;
                                {
                                        if (align)
                                                pos_x = panel_pos_x + (panel_size_x - stringwidth(ts, TRUE, fontsize)) * align;
-                                       if (a > 0.5/256.0)  // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker.
+                                       if (a > 0.5/255.0)  // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker.
                                                drawcolorcodedstring(pos + eY * 0.5 * (1 - sz) * fontsize_y, ts, fontsize, a, DRAWFLAG_NORMAL);
                                        pos_y += fontsize_y;
                                }
                                                drawcolorcodedstring(pos + eY * 0.5 * (1 - sz) * fontsize_y, ts, fontsize, a, DRAWFLAG_NORMAL);
                                        pos_y += fontsize_y;
                                }
@@ -4386,7 +4386,7 @@ void HUD_CenterPrint (void)
                }
        }
        drawfontscale = '1 1 0';
                }
        }
        drawfontscale = '1 1 0';
-       if (n == -1)
+       if (all_messages_expired)
        {
                centerprint_showing = FALSE;
                reset_centerprint_messages();
        {
                centerprint_showing = FALSE;
                reset_centerprint_messages();