Skip to content

Commit

Permalink
Provide better error message if server didn't set map.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet authored and res2k committed Jan 21, 2024
1 parent 2c61087 commit c2795fa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/client/precache.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,15 @@ Registers main BSP file and inline models
*/
void CL_RegisterBspModels(void)
{
int ret;
char *name;
int i;
char *name = cl.configstrings[CS_MODELS + 1];
int i, ret;

ret = BSP_Load(cl.configstrings[CS_MODELS + 1], &cl.bsp);
if (!name[0]) {
Com_Error(ERR_DROP, "%s: no map set", __func__);
}
ret = BSP_Load(name, &cl.bsp);
if (cl.bsp == NULL) {
Com_Error(ERR_DROP, "Couldn't load %s: %s",
cl.configstrings[CS_MODELS + 1], BSP_ErrorString(ret));
Com_Error(ERR_DROP, "Couldn't load %s: %s", name, BSP_ErrorString(ret));
}

if (cl.bsp->checksum != atoi(cl.configstrings[CS_MAPCHECKSUM])) {
Expand Down

0 comments on commit c2795fa

Please sign in to comment.