From cc2f531faa21daea994b37da43b17211d6369d2b Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 24 Mar 2024 14:18:26 +0200 Subject: [PATCH] server: extend count of sound indexes --- src/client/cl_parse.c | 9 ++++++++- src/common/header/shared.h | 2 +- src/server/sv_send.c | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 391c01f4..18c15edc 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -1228,7 +1228,14 @@ CL_ParseStartSoundPacket(void) float ofs; flags = MSG_ReadByte(&net_message); - sound_num = MSG_ReadByte(&net_message); + if (IS_QII97_PROTOCOL(cls.serverProtocol)) + { + sound_num = MSG_ReadByte(&net_message); + } + else + { + sound_num = MSG_ReadShort(&net_message); + } if (flags & SND_VOLUME) { diff --git a/src/common/header/shared.h b/src/common/header/shared.h index 30036e76..8cfa9b10 100644 --- a/src/common/header/shared.h +++ b/src/common/header/shared.h @@ -174,7 +174,7 @@ typedef unsigned char byte; #define MAX_EDICTS 1024 /* must change protocol to increase more */ #define MAX_LIGHTSTYLES 256 #define MAX_MODELS 512 /* these are sent over the net as bytes */ -#define MAX_SOUNDS 256 /* so they cannot be blindly increased */ +#define MAX_SOUNDS 512 /* so they cannot be blindly increased */ #define MAX_IMAGES 256 #define MAX_ITEMS 256 #define MAX_GENERAL (MAX_CLIENTS * 2) /* general config strings */ diff --git a/src/server/sv_send.c b/src/server/sv_send.c index e838c5cf..7a3b4ef5 100644 --- a/src/server/sv_send.c +++ b/src/server/sv_send.c @@ -370,7 +370,14 @@ SV_StartSound(vec3_t origin, edict_t *entity, int channel, int soundindex, MSG_WriteByte(&sv.multicast, svc_sound); MSG_WriteByte(&sv.multicast, flags); - MSG_WriteByte(&sv.multicast, soundindex); + if (IS_QII97_PROTOCOL(sv_client->protocol)) + { + MSG_WriteByte(&sv.multicast, soundindex); + } + else + { + MSG_WriteShort(&sv.multicast, soundindex); + } if (flags & SND_VOLUME) {