]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Set 2 cvars only when needed
authorterencehill <piuntn@gmail.com>
Mon, 5 Jul 2021 21:07:28 +0000 (23:07 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 5 Jul 2021 21:07:28 +0000 (23:07 +0200)
qcsrc/client/hud/panel/chat.qc

index 7515d23fb82d60e263fbdf95cf4f56d4b4114f26..07de3b7dd1b9b4b586606dd1dd59432604404789 100644 (file)
@@ -17,7 +17,7 @@ void HUD_Chat()
                {
                        if (autocvar_con_chatrect)
                                cvar_set("con_chatrect", "0");
-                       if (autocvar_con_chat)
+                       if (autocvar_con_chat != -1)
                                cvar_set("con_chat", "-1");
                        return;
                }
@@ -93,7 +93,8 @@ void HUD_Chat()
        if(autocvar__hud_configure)
        {
                vector chatsize = '1 1 0' * autocvar_con_chatsize;
-               cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
+               if (cvar_string("con_chatrect_x") != "9001")
+                       cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
                string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors);
                for(int i = 0; i < autocvar_con_chat; ++i)
                {