Support definition of additional sector types in sector.config,

missing bits:
(budg, calc_all, update_main): Use SCT_TYPE_MAX instead of SCT_MAXDEF
to size tables.
(map_char): Update sanity check; use CANT_HAPPEN().
(show_sect_build, show_sect_stats, show_sect_capab): Use the sentinel
instead of SCT_MAXDEF.
This commit is contained in:
Markus Armbruster 2006-06-22 20:21:48 +00:00
parent 063aabb893
commit 9e8f74d239
4 changed files with 9 additions and 10 deletions

View file

@ -290,10 +290,8 @@ bmnxtsct(struct nstr_sect *np)
static char
map_char(unsigned char type, natid own, int owner_or_god)
{
if (type > SCT_MAXDEF) {
logerror("bad sector type %d\n", type);
if (CANT_HAPPEN(type > SCT_TYPE_MAX || !dchr[type].d_mnem))
return '?';
}
if (owner_or_god
|| type == SCT_WATER || type == SCT_MOUNT || type == SCT_WASTE
|| (!own && (type == SCT_RURAL || type == SCT_PLAINS)))