From 9e5728244ea136df1541e0c216f27032b9e75c8a Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 7 Apr 2023 02:07:45 -0700 Subject: [PATCH] don't error out when buildingplan is loaded at DF start --- plugins/buildingplan/buildingplan.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/buildingplan/buildingplan.cpp b/plugins/buildingplan/buildingplan.cpp index eb765c1c4..2193b380b 100644 --- a/plugins/buildingplan/buildingplan.cpp +++ b/plugins/buildingplan/buildingplan.cpp @@ -742,6 +742,8 @@ static int countAvailableItems(color_ostream &out, df::building_type type, int16 static bool hasFilter(color_ostream &out, df::building_type type, int16_t subtype, int32_t custom, int index) { TRACE(status,out).print("entering hasFilter\n"); + if (!Core::getInstance().isWorldLoaded()) + return false; BuildingTypeKey key(type, subtype, custom); auto &filters = get_item_filters(out, key); if (index < 0 || filters.getItemFilters().size() <= (size_t)index)