lowmemory: fix sentences

This commit is contained in:
mittorn 2019-10-28 12:07:15 +07:00
parent ba1347a8ce
commit 37cba10c14
3 changed files with 8 additions and 6 deletions

View File

@ -92,7 +92,7 @@ void CL_ParseSoundPacket( sizebuf_t *msg )
char sentenceName[32];
if( FBitSet( flags, SND_SEQUENCE ))
Q_snprintf( sentenceName, sizeof( sentenceName ), "!#%i", sound + MAX_SOUNDS );
Q_snprintf( sentenceName, sizeof( sentenceName ), "!#%i", sound + MAX_SOUNDS_NONSENTENCE );
else Q_snprintf( sentenceName, sizeof( sentenceName ), "!%i", sound );
handle = S_RegisterSound( sentenceName );
@ -156,7 +156,7 @@ void CL_ParseRestoreSoundPacket( sizebuf_t *msg )
char sentenceName[32];
if( flags & SND_SEQUENCE )
Q_snprintf( sentenceName, sizeof( sentenceName ), "!%i", sound + MAX_SOUNDS );
Q_snprintf( sentenceName, sizeof( sentenceName ), "!%i", sound + MAX_SOUNDS_NONSENTENCE );
else Q_snprintf( sentenceName, sizeof( sentenceName ), "!%i", sound );
handle = S_RegisterSound( sentenceName );

View File

@ -119,6 +119,7 @@ GNU General Public License for more details.
#define MAX_SOUND_BITS 11
#define MAX_SOUNDS (1<<MAX_SOUND_BITS) // 11 bits == 2048 sounds
#define MAX_SOUNDS_NONSENTENCE MAX_SOUNDS
#define MAX_ENTITY_BITS 13 // 13 bits = 8192 edicts
#define MAX_EDICTS (1<<MAX_ENTITY_BITS)
@ -147,8 +148,9 @@ GNU General Public License for more details.
#define MAX_MODELS 256
#define MAX_SOUND_BITS 8
#define MAX_SOUNDS (1<<MAX_SOUND_BITS) // 11 bits == 2048 sounds
#define MAX_SOUNDS 512 // do not change MAX_SOUND_BITS
#define MAX_SOUNDS_NONSENTENCE 2048
#define MAX_CUSTOM_BITS 4
#define MAX_CUSTOM (1<<MAX_CUSTOM_BITS)// 10 bits == 1024 generic file

View File

@ -2042,10 +2042,10 @@ int SV_BuildSoundMsg( sizebuf_t *msg, edict_t *ent, int chan, const char *sample
{
sound_idx = Q_atoi( sample + 1 );
if( sound_idx >= MAX_SOUNDS )
if( sound_idx >= MAX_SOUNDS_NONSENTENCE )
{
SetBits( flags, SND_SENTENCE|SND_SEQUENCE );
sound_idx -= MAX_SOUNDS;
sound_idx -= MAX_SOUNDS_NONSENTENCE;
}
else SetBits( flags, SND_SENTENCE );
}