From: terencehill Date: Sun, 21 Jun 2020 15:18:12 +0000 (+0200) Subject: Fix client version of ambientsound, a buffer position check and a typo. Add missing... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d72d1e674554b2539c5f613a500a7c5abe7749fb;p=xonotic%2Fdarkplaces.git Fix client version of ambientsound, a buffer position check and a typo. Add missing strireplace from dpdefs/menudefs.qc --- diff --git a/clvm_cmds.c b/clvm_cmds.c index ef432e6e..727af941 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -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); } diff --git a/console.c b/console.c index 6b3545e8..3c4644bd 100644 --- 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++] = ' '; diff --git a/dpdefs/csprogsdefs.qc b/dpdefs/csprogsdefs.qc index 572f9ba7..886b50e1 100644 --- a/dpdefs/csprogsdefs.qc +++ b/dpdefs/csprogsdefs.qc @@ -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; diff --git a/dpdefs/menudefs.qc b/dpdefs/menudefs.qc index 8d24bf42..1890a4b0 100644 --- a/dpdefs/menudefs.qc +++ b/dpdefs/menudefs.qc @@ -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;