(obj_nameof): Return safer error value.
(get_empobjp, get_empobj_chr, emp_obj_chr_name, get_empobj_mob_max): Style.
This commit is contained in:
parent
f7233ff841
commit
7e474afa32
1 changed files with 5 additions and 9 deletions
|
@ -54,7 +54,7 @@ obj_nameof(struct empobj *gp)
|
||||||
return prnuke((struct nukstr *)gp);
|
return prnuke((struct nukstr *)gp);
|
||||||
}
|
}
|
||||||
CANT_REACH();
|
CANT_REACH();
|
||||||
return "";
|
return "The Beast #666";
|
||||||
}
|
}
|
||||||
|
|
||||||
struct empobj *
|
struct empobj *
|
||||||
|
@ -62,8 +62,7 @@ get_empobjp(int type, int id)
|
||||||
{
|
{
|
||||||
if (CANT_HAPPEN(type == EF_SECTOR || type == EF_BAD))
|
if (CANT_HAPPEN(type == EF_SECTOR || type == EF_BAD))
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
return ef_ptr(type, id);
|
||||||
return (struct empobj *)ef_ptr(type, id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -96,9 +95,8 @@ get_empobj_chr(struct empobj *gp)
|
||||||
return &nchr[(int)gp->type];
|
return &nchr[(int)gp->type];
|
||||||
case EF_SECTOR:
|
case EF_SECTOR:
|
||||||
return &dchr[(int)gp->type];
|
return &dchr[(int)gp->type];
|
||||||
default:
|
|
||||||
CANT_REACH();
|
|
||||||
}
|
}
|
||||||
|
CANT_REACH();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,9 +114,8 @@ emp_obj_chr_name(struct empobj *gp)
|
||||||
return nchr[(int)gp->type].n_name;
|
return nchr[(int)gp->type].n_name;
|
||||||
case EF_SECTOR:
|
case EF_SECTOR:
|
||||||
return dchr[(int)gp->type].d_name;
|
return dchr[(int)gp->type].d_name;
|
||||||
default:
|
|
||||||
CANT_REACH();
|
|
||||||
}
|
}
|
||||||
|
CANT_REACH();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,8 +131,7 @@ get_empobj_mob_max(int type)
|
||||||
return plane_mob_max;
|
return plane_mob_max;
|
||||||
case EF_SECTOR:
|
case EF_SECTOR:
|
||||||
return sect_mob_max;
|
return sect_mob_max;
|
||||||
default:
|
|
||||||
CANT_REACH();
|
|
||||||
}
|
}
|
||||||
|
CANT_REACH();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue