@@ -683,22 +683,22 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int
683
683
684
684
if (volume < 0 || volume > 255 )
685
685
{
686
- Con_Printf (" %s: volume = %i" , __func__, volume);
686
+ Con_Printf (" %s: volume = %i\n " , __func__, volume);
687
687
volume = (volume < 0 ) ? 0 : 255 ;
688
688
}
689
689
if (attenuation < 0 .0f || attenuation > 4 .0f )
690
690
{
691
- Con_Printf (" %s: attenuation = %f" , __func__, attenuation);
691
+ Con_Printf (" %s: attenuation = %f\n " , __func__, attenuation);
692
692
attenuation = (attenuation < 0 .0f ) ? 0 .0f : 4 .0f ;
693
693
}
694
694
if (channel < 0 || channel > 7 )
695
695
{
696
- Con_Printf (" %s: channel = %i" , __func__, channel);
696
+ Con_Printf (" %s: channel = %i\n " , __func__, channel);
697
697
channel = (channel < 0 ) ? CHAN_AUTO : CHAN_NETWORKVOICE_BASE;
698
698
}
699
699
if (pitch < 0 || pitch > 255 )
700
700
{
701
- Con_Printf (" %s: pitch = %i" , __func__, pitch);
701
+ Con_Printf (" %s: pitch = %i\n " , __func__, pitch);
702
702
pitch = (pitch < 0 ) ? 0 : 255 ;
703
703
}
704
704
@@ -710,7 +710,7 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int
710
710
sound_num = Q_atoi (sample + 1 );
711
711
if (sound_num >= CVOXFILESENTENCEMAX)
712
712
{
713
- Con_Printf (" %s: invalid sentence number: %s" , __func__, sample + 1 );
713
+ Con_Printf (" %s: invalid sentence number: %s\n " , __func__, sample + 1 );
714
714
return FALSE ;
715
715
}
716
716
}
@@ -1115,8 +1115,18 @@ void SV_SendServerinfo_internal(sizebuf_t *msg, client_t *client)
1115
1115
else
1116
1116
MSG_WriteByte (msg, 0 );
1117
1117
1118
- COM_FileBase (com_gamedir, message);
1119
- MSG_WriteString (msg, message);
1118
+ const char *pszGameDir = message;
1119
+
1120
+ #ifdef REHLDS_FIXES
1121
+ // Give the client a chance to connect in to the server with different game
1122
+ const char *gd = Info_ValueForKey (client->userinfo , " _gd" );
1123
+ if (gd[0 ])
1124
+ pszGameDir = gd;
1125
+ else
1126
+ #endif
1127
+ COM_FileBase (com_gamedir, message);
1128
+
1129
+ MSG_WriteString (msg, pszGameDir);
1120
1130
MSG_WriteString (msg, Cvar_VariableString (" hostname" ));
1121
1131
MSG_WriteString (msg, g_psv.modelname );
1122
1132
@@ -4033,9 +4043,10 @@ void SV_EmitEvents_internal(client_t *cl, packet_entities_t *pack, sizebuf_t *ms
4033
4043
}
4034
4044
4035
4045
int fatbytes;
4036
- unsigned char fatpvs[1024 ];
4046
+ unsigned char fatpvs[MAX_MAP_LEAFS / 8 ];
4047
+
4037
4048
int fatpasbytes;
4038
- unsigned char fatpas[1024 ];
4049
+ unsigned char fatpas[MAX_MAP_LEAFS / 8 ];
4039
4050
4040
4051
void SV_AddToFatPVS (vec_t *org, mnode_t *node)
4041
4052
{
@@ -4077,6 +4088,9 @@ unsigned char* EXT_FUNC SV_FatPVS(float *org)
4077
4088
#endif // REHLDS_FIXES
4078
4089
fatbytes = (g_psv.worldmodel ->numleafs + 31 ) >> 3 ;
4079
4090
4091
+ if (fatbytes >= (MAX_MAP_LEAFS / 8 ))
4092
+ Sys_Error (" %s: MAX_MAP_LEAFS limit exceeded\n " , __func__);
4093
+
4080
4094
Q_memset (fatpvs, 0 , fatbytes);
4081
4095
SV_AddToFatPVS (org, g_psv.worldmodel ->nodes );
4082
4096
return fatpvs;
@@ -4134,6 +4148,9 @@ unsigned char* EXT_FUNC SV_FatPAS(float *org)
4134
4148
#endif // REHLDS_FIXES
4135
4149
fatpasbytes = (g_psv.worldmodel ->numleafs + 31 ) >> 3 ;
4136
4150
4151
+ if (fatpasbytes >= (MAX_MAP_LEAFS / 8 ))
4152
+ Sys_Error (" %s: MAX_MAP_LEAFS limit exceeded\n " , __func__);
4153
+
4137
4154
Q_memset (fatpas, 0 , fatpasbytes);
4138
4155
SV_AddToFatPAS (org, g_psv.worldmodel ->nodes );
4139
4156
return fatpas;
@@ -6158,7 +6175,7 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot)
6158
6175
if (g_psvs.maxclients <= 1 )
6159
6176
{
6160
6177
int row = (g_psv.worldmodel ->numleafs + 7 ) / 8 ;
6161
- if (row < 0 || row > MODEL_MAX_PVS )
6178
+ if (row < 0 || row > (MAX_MAP_LEAFS / 8 ) )
6162
6179
{
6163
6180
Sys_Error (" %s: oversized g_psv.worldmodel->numleafs: %i" , __func__, g_psv.worldmodel ->numleafs );
6164
6181
}
0 commit comments