do not crash when there's no generic building type

This commit is contained in:
Enno Rehling 2005-12-11 15:30:05 +00:00
parent ca352dc60a
commit b2bd092252
1 changed files with 3 additions and 2 deletions

View File

@ -175,11 +175,12 @@ const char *
buildingtype(const building_type * btype, const building * b, int bsize)
{
const char * s = NULL;
static boolean init_generic = false;
static const struct building_type * bt_generic;
if (!bt_generic) {
if (!init_generic) {
init_generic = true;
bt_generic = bt_find("generic");
assert(bt_generic);
}
if (btype == bt_generic) {