From 836ef855f78cebe3765e09b89545ebdd9350d6a3 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 5 Jul 2021 23:07:28 +0200 Subject: [PATCH] Set 2 cvars only when needed --- qcsrc/client/hud/panel/chat.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index 7515d23fb..07de3b7dd 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -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) { -- 2.39.2