Fix local hitsound priority

Local hitsounds (/hitsound 2) work by running CubeScript
command `sound`, passing hitsound sound number and
priority (highest). However, `sound` command doesn't actually
take the second priority argument and always uses default normal
priority.

This commit adds the second prioity argument to `sound`.
It accepts numeric priority levels as well as string names.

Also use highest priority for server hitsounds (to be consistent with
local hitsounds).

(was pull request #164)

DOCREF sound
This commit is contained in:
gy_be
2017-04-20 13:53:55 +02:00
committed by ac-stef
parent c2d64d3a2b
commit 9820e59adb
3 changed files with 9 additions and 6 deletions
+3 -3
View File
@@ -1832,9 +1832,9 @@ COMMANDF(getmode, "i", (int *acr) { result(modestr(gamemode, *acr != 0)); });
void listoptions(char *s)
{
extern const char *menufilesortorders[], *texturestacktypes[];
const char *optionnames[] = { "entities", "ents", "weapons", "teamnames", "teamnames-abbrv", "punctuations", "crosshairnames", "menufilesortorders", "texturestacktypes", "cubetypes", "" };
const char **optionlists[] = { optionnames, entnames + 1, entnames + 1, gunnames, teamnames, teamnames_s, punctnames, crosshairnames, menufilesortorders, texturestacktypes, cubetypenames };
extern const char *menufilesortorders[], *texturestacktypes[], *soundprioritynames[];
const char *optionnames[] = { "entities", "ents", "weapons", "teamnames", "teamnames-abbrv", "punctuations", "crosshairnames", "menufilesortorders", "texturestacktypes", "cubetypes", "soundpriorities", "" };
const char **optionlists[] = { optionnames, entnames + 1, entnames + 1, gunnames, teamnames, teamnames_s, punctnames, crosshairnames, menufilesortorders, texturestacktypes, cubetypenames, soundprioritynames };
const char **listp = optionlists[getlistindex(s, optionnames, true, -1) + 1];
commandret = conc(listp, -1, true);
}