From: terencehill Date: Mon, 5 Jul 2021 21:07:28 +0000 (+0200) Subject: Set 2 cvars only when needed X-Git-Tag: xonotic-v0.8.5~382 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=836ef855f78cebe3765e09b89545ebdd9350d6a3;p=xonotic%2Fxonotic-data.pk3dir.git Set 2 cvars only when needed --- 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) {