]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - utf8lib.c
Initialize console commands and cvars before anything else
[xonotic/darkplaces.git] / utf8lib.c
index 255c44f55619769b0c0c8e58af36e13b4bea93d1..ebb06776f8bbe65bc23b04bb3fbf64c5ce91f5fa 100644 (file)
--- a/utf8lib.c
+++ b/utf8lib.c
@@ -7,9 +7,9 @@ Initialization of UTF-8 support and new cvars.
 ================================================================================
 */
 // for compatibility this defaults to 0
-cvar_t    utf8_enable = {CVAR_SAVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
+cvar_t utf8_enable = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "utf8_enable", "0", "Enable UTF-8 support. For compatibility, this is disabled by default in most games."};
 
-void   u8_Init(void)
+void u8_Init_Commands(void)
 {
        Cvar_RegisterVariable(&utf8_enable);
 }
@@ -800,7 +800,7 @@ u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
                {
                        case 0:
                                if(valid)
-                                       *valid = TRUE;
+                                       *valid = true;
                                return len;
                        case STRING_COLOR_TAG:
                                ++s;
@@ -820,7 +820,7 @@ u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
                                        case 0: // ends with unfinished color code!
                                                ++len;
                                                if(valid)
-                                                       *valid = FALSE;
+                                                       *valid = false;
                                                return len;
                                        case STRING_COLOR_TAG: // escaped ^
                                                ++len;
@@ -858,7 +858,7 @@ u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
                {
                        // we CAN end up here, if an invalid char is between this one and the end of the string
                        if(valid)
-                               *valid = TRUE;
+                               *valid = true;
                        return len;
                }
 
@@ -866,7 +866,7 @@ u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qboolean *valid)
                {
                        // string length exceeded by new character
                        if(valid)
-                               *valid = TRUE;
+                               *valid = true;
                        return len;
                }