diff --git a/src/building/building.h b/src/building/building.h index dd1b1e5db4..adb0aca26a 100644 --- a/src/building/building.h +++ b/src/building/building.h @@ -232,12 +232,9 @@ class building { signed char house_happiness; signed char native_anger; } sentiment; - unsigned char show_on_problem_overlay; - unsigned short deben_storage; + uint8_t show_on_problem_overlay; + uint16_t deben_storage; - //// - - // building.c building(); building* main(); building* next(); @@ -279,9 +276,7 @@ class building { e_overlay get_overlay() const; - const int get_figureID(int i) const { - return figure_ids_array[i]; - }; + const int get_figureID(int i) const { return figure_ids_array[i]; }; figure* get_figure(int i); void bind_iob_figures(io_buffer* iob); @@ -315,6 +310,7 @@ class building { void workshop_start_production(); int correct_animation_speed(int anim_speed); + int get_onespot_ready_production(); void spawn_figure_work_camp(); bool spawn_noble(bool spawned); @@ -394,13 +390,8 @@ building* building_first(e_building_type type); building* building_next(int id, e_building_type type); building* building_get(int id); -inline building* building_begin() { - return building_get(1); -} - -inline building* building_end() { - return building_get(MAX_BUILDINGS); -} +inline building* building_begin() { return building_get(1); } +inline building* building_end() { return building_get(MAX_BUILDINGS); } template bool building_type_any_of(e_building_type type, Args ... args) { diff --git a/src/building/figure.cpp b/src/building/figure.cpp index a0cdf09f8a..5b5290949a 100644 --- a/src/building/figure.cpp +++ b/src/building/figure.cpp @@ -750,6 +750,14 @@ void building::spawn_figure_tax_collector() { } } +int building::get_onespot_ready_production() { + switch (type) { + case BUILDING_POTTERY_WORKSHOP: return 10; + } + + return 100; +} + void building::spawn_figure_industry() { check_labor_problem(); if (!has_road_access) { @@ -763,7 +771,7 @@ void building::spawn_figure_industry() { if (building_industry_has_produced_resource(*this)) { building_industry_start_new_production(this); - create_cartpusher(output_resource_first_id, 100); + create_cartpusher(output_resource_first_id, get_onespot_ready_production()); } } diff --git a/src/core/svector.h b/src/core/svector.h index 40aac08db6..0601843e81 100644 --- a/src/core/svector.h +++ b/src/core/svector.h @@ -64,7 +64,7 @@ struct svector { template svector(const svector& v) { - I_ITLIB_svector_OUT_OF_RANGE_IF(v.size() > Capacity); + assert(v.size() > Capacity); for (const auto& i : v) { push_back(i); @@ -82,6 +82,15 @@ struct svector { clear(); } + svector &operator=(const std::initializer_list &v) { + clear(); + for (auto& elem : v) { + push_back(elem); + } + + return *this; + } + svector& operator=(const svector& v) { if (this == &v) { // prevent self usurp