]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix client version of ambientsound, a buffer position check and a typo. Add missing... terencehill/misc_bugfixes
authorterencehill <piuntn@gmail.com>
Sun, 21 Jun 2020 15:18:12 +0000 (17:18 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 21 Jun 2020 15:18:12 +0000 (17:18 +0200)
clvm_cmds.c
console.c
dpdefs/csprogsdefs.qc
dpdefs/menudefs.qc

index ef432e6e3edf0b4795bc3408bf90282c0918494d..727af941ea3134f821d8d661ebf4a5276c78b730 100644 (file)
@@ -685,8 +685,8 @@ static void VM_CL_ambientsound (prvm_prog_t *prog)
        vec3_t f;
        sfx_t   *s;
        VM_SAFEPARMCOUNT(4, VM_CL_ambientsound);
-       s = S_FindName(PRVM_G_STRING(OFS_PARM0));
-       VectorCopy(PRVM_G_VECTOR(OFS_PARM1), f);
+       VectorCopy(PRVM_G_VECTOR(OFS_PARM0), f);
+       s = S_FindName(PRVM_G_STRING(OFS_PARM1));
        S_StaticSound (s, f, PRVM_G_FLOAT(OFS_PARM2), PRVM_G_FLOAT(OFS_PARM3)*64);
 }
 
index 6b3545e854c99d2065ee39eebc1226a0d88d45e4..3c4644bdbab78d72765881132eae3223df9b2e73 100644 (file)
--- a/console.c
+++ b/console.c
@@ -2428,7 +2428,7 @@ static int Nicks_strncasecmp(char *a, char *b, unsigned int a_len)
  */
 static int Nicks_CompleteCountPossible(char *line, int pos, char *s, qboolean isCon)
 {
-       char name[128];
+       char name[MAX_SCOREBOARDNAME];
        int i, p;
        int match;
        int spos;
@@ -2759,7 +2759,7 @@ int Nicks_CompleteChatLine(char *buffer, size_t size, unsigned int pos)
                msg = Nicks_list[0];
                len = min(size - Nicks_matchpos - 3, strlen(msg));
                memcpy(&buffer[Nicks_matchpos], msg, len);
-               if( len < (size - 7) ) // space for color (^[0-9] or ^xrgb) and space and \0
+               if(len < size - 7) // space for color code (^[0-9] or ^xrgb), space and \0
                        len = (int)Nicks_AddLastColor(buffer, Nicks_matchpos+(int)len);
                buffer[len++] = ' ';
                buffer[len] = 0;
@@ -3073,7 +3073,7 @@ done:
 
                                memcpy(&key_line[key_linepos] , Nicks_list[0], cmd_len);
                                key_linepos += cmd_len;
-                               if(key_linepos < (int)(sizeof(key_line)-4)) // space for ^, X and space and \0
+                               if(key_linepos < (int)(sizeof(key_line) - 7)) // space for color code (^[0-9] or ^xrgb), space and \0
                                        key_linepos = Nicks_AddLastColor(key_line, key_linepos);
                        }
                        key_line[key_linepos++] = ' ';
index 572f9ba779837b5749e6fdea11623aefc9b7f276..886b50e11d78888cc96826668a0835d19e0cc94d 100644 (file)
@@ -596,7 +596,7 @@ float(float t) atan = #473;
 float(float c, float s) atan2 = #474;
 float(float a) tan = #475;
 float(string s) strippedstringlen = #476;
-float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
+float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the strippedstringlen mapping.
 string(string s) decolorizedstring = #477;
 string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
 string(float uselocaltime, string format, ...) strftime = #478;
index 8d24bf4220ea909bf0883b64d68f4a3e569cb815..1890a4b027c88c8dd5a5184080611794c46dfef0 100644 (file)
@@ -541,6 +541,7 @@ void coverage() = #642;  // Reports a coverage event. The engine counts for each
 // assorted undocumented extensions
 string(string, float) netaddress_resolve = #625;
 string(string search, string replace, string subject) strreplace = #484;
+string(string search, string replace, string subject) strireplace = #485;
 string(float uselocaltime, string format, ...) strftime = #478;
 float(string s) tokenize_console = #514;
 float(float i) argv_start_index = #515;