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:
@@ -773,9 +773,12 @@ bool staticreference::operator==(const worldobjreference &other)
|
||||
|
||||
audiomanager audiomgr;
|
||||
|
||||
COMMANDF(sound, "i", (int *n)
|
||||
const char *soundprioritynames[] = {"LOW", "NORMAL", "HIGH", "HIGHEST", ""}; // keep in sync with enum { SP_LOW = 0, SP_NORMAL, SP_HIGH, SP_HIGHEST }
|
||||
|
||||
COMMANDF(sound, "is", (int *n, char *priorityname)
|
||||
{
|
||||
audiomgr.playsound(*n);
|
||||
int priority = getlistindex(priorityname, soundprioritynames, true, SP_NORMAL);
|
||||
audiomgr.playsound(*n, priority);
|
||||
});
|
||||
|
||||
COMMANDF(applymapsoundchanges, "", (){
|
||||
|
||||
Reference in New Issue
Block a user