forked from github/server
do not crash when there's no generic building type
This commit is contained in:
parent
ca352dc60a
commit
b2bd092252
|
@ -175,11 +175,12 @@ const char *
|
||||||
buildingtype(const building_type * btype, const building * b, int bsize)
|
buildingtype(const building_type * btype, const building * b, int bsize)
|
||||||
{
|
{
|
||||||
const char * s = NULL;
|
const char * s = NULL;
|
||||||
|
static boolean init_generic = false;
|
||||||
static const struct building_type * bt_generic;
|
static const struct building_type * bt_generic;
|
||||||
|
|
||||||
if (!bt_generic) {
|
if (!init_generic) {
|
||||||
|
init_generic = true;
|
||||||
bt_generic = bt_find("generic");
|
bt_generic = bt_find("generic");
|
||||||
assert(bt_generic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btype == bt_generic) {
|
if (btype == bt_generic) {
|
||||||
|
|
Loading…
Reference in New Issue