diff --git a/common/city.cpp b/common/city.cpp index 96b35d7b58..0772e700e0 100644 --- a/common/city.cpp +++ b/common/city.cpp @@ -2247,6 +2247,10 @@ void add_specialist_output( // This is more than just an optimization. For governors that forbid // specialists, the cache may not be filled. if (count > 0) { + // If there is a cache it must not be empty. + fc_assert_action(!pcsoutputs || !pcsoutputs->empty(), + pcsoutputs = nullptr); + output_type_iterate(stat_index) { int amount = pcsoutputs @@ -2870,6 +2874,9 @@ void set_city_production(struct city *pcity, trade_routes_iterate_end; pcity->prod[O_GOLD] += get_city_tithes_bonus(pcity); + // If there is a cache it must not be empty. + fc_assert_action(!pcwaste || !pcwaste->empty(), pcwaste = nullptr); + /* Account for waste. Note that waste is calculated before tax income is * calculated, so if you had "science waste" it would not include taxed * science. However waste is calculated after the bonuses are multiplied