@@ -680,22 +680,22 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int
680
680
681
681
if (volume < 0 || volume > 255 )
682
682
{
683
- Con_Printf (" %s: volume = %i" , __func__, volume);
683
+ Con_Printf (" %s: volume = %i\n " , __func__, volume);
684
684
volume = (volume < 0 ) ? 0 : 255 ;
685
685
}
686
686
if (attenuation < 0 .0f || attenuation > 4 .0f )
687
687
{
688
- Con_Printf (" %s: attenuation = %f" , __func__, attenuation);
688
+ Con_Printf (" %s: attenuation = %f\n " , __func__, attenuation);
689
689
attenuation = (attenuation < 0 .0f ) ? 0 .0f : 4 .0f ;
690
690
}
691
691
if (channel < 0 || channel > 7 )
692
692
{
693
- Con_Printf (" %s: channel = %i" , __func__, channel);
693
+ Con_Printf (" %s: channel = %i\n " , __func__, channel);
694
694
channel = (channel < 0 ) ? CHAN_AUTO : CHAN_NETWORKVOICE_BASE;
695
695
}
696
696
if (pitch < 0 || pitch > 255 )
697
697
{
698
- Con_Printf (" %s: pitch = %i" , __func__, pitch);
698
+ Con_Printf (" %s: pitch = %i\n " , __func__, pitch);
699
699
pitch = (pitch < 0 ) ? 0 : 255 ;
700
700
}
701
701
@@ -707,7 +707,7 @@ qboolean SV_BuildSoundMsg(edict_t *entity, int channel, const char *sample, int
707
707
sound_num = Q_atoi (sample + 1 );
708
708
if (sound_num >= CVOXFILESENTENCEMAX)
709
709
{
710
- Con_Printf (" %s: invalid sentence number: %s" , __func__, sample + 1 );
710
+ Con_Printf (" %s: invalid sentence number: %s\n " , __func__, sample + 1 );
711
711
return FALSE ;
712
712
}
713
713
}
@@ -1112,8 +1112,18 @@ void SV_SendServerinfo_internal(sizebuf_t *msg, client_t *client)
1112
1112
else
1113
1113
MSG_WriteByte (msg, 0 );
1114
1114
1115
- COM_FileBase (com_gamedir, message);
1116
- MSG_WriteString (msg, message);
1115
+ const char *pszGameDir = message;
1116
+
1117
+ #ifdef REHLDS_FIXES
1118
+ // Give the client a chance to connect in to the server with different game
1119
+ const char *gd = Info_ValueForKey (client->userinfo , " _gd" );
1120
+ if (gd[0 ])
1121
+ pszGameDir = gd;
1122
+ else
1123
+ #endif
1124
+ COM_FileBase (com_gamedir, message);
1125
+
1126
+ MSG_WriteString (msg, pszGameDir);
1117
1127
MSG_WriteString (msg, Cvar_VariableString (" hostname" ));
1118
1128
MSG_WriteString (msg, g_psv.modelname );
1119
1129
@@ -4030,9 +4040,10 @@ void SV_EmitEvents_internal(client_t *cl, packet_entities_t *pack, sizebuf_t *ms
4030
4040
}
4031
4041
4032
4042
int fatbytes;
4033
- unsigned char fatpvs[1024 ];
4043
+ unsigned char fatpvs[MAX_MAP_LEAFS / 8 ];
4044
+
4034
4045
int fatpasbytes;
4035
- unsigned char fatpas[1024 ];
4046
+ unsigned char fatpas[MAX_MAP_LEAFS / 8 ];
4036
4047
4037
4048
void SV_AddToFatPVS (vec_t *org, mnode_t *node)
4038
4049
{
@@ -4074,6 +4085,9 @@ unsigned char* EXT_FUNC SV_FatPVS(float *org)
4074
4085
#endif // REHLDS_FIXES
4075
4086
fatbytes = (g_psv.worldmodel ->numleafs + 31 ) >> 3 ;
4076
4087
4088
+ if (fatbytes >= (MAX_MAP_LEAFS / 8 ))
4089
+ Sys_Error (" %s: MAX_MAP_LEAFS limit exceeded\n " , __func__);
4090
+
4077
4091
Q_memset (fatpvs, 0 , fatbytes);
4078
4092
SV_AddToFatPVS (org, g_psv.worldmodel ->nodes );
4079
4093
return fatpvs;
@@ -4131,6 +4145,9 @@ unsigned char* EXT_FUNC SV_FatPAS(float *org)
4131
4145
#endif // REHLDS_FIXES
4132
4146
fatpasbytes = (g_psv.worldmodel ->numleafs + 31 ) >> 3 ;
4133
4147
4148
+ if (fatpasbytes >= (MAX_MAP_LEAFS / 8 ))
4149
+ Sys_Error (" %s: MAX_MAP_LEAFS limit exceeded\n " , __func__);
4150
+
4134
4151
Q_memset (fatpas, 0 , fatpasbytes);
4135
4152
SV_AddToFatPAS (org, g_psv.worldmodel ->nodes );
4136
4153
return fatpas;
@@ -6155,7 +6172,7 @@ int SV_SpawnServer(qboolean bIsDemo, char *server, char *startspot)
6155
6172
if (g_psvs.maxclients <= 1 )
6156
6173
{
6157
6174
int row = (g_psv.worldmodel ->numleafs + 7 ) / 8 ;
6158
- if (row < 0 || row > MODEL_MAX_PVS )
6175
+ if (row < 0 || row > (MAX_MAP_LEAFS / 8 ) )
6159
6176
{
6160
6177
Sys_Error (" %s: oversized g_psv.worldmodel->numleafs: %i" , __func__, g_psv.worldmodel ->numleafs );
6161
6178
}
0 commit comments