@@ -144,11 +144,12 @@ bool hausbauer_t::successfully_loaded()
144144
145145 if (desc->is_city_building ()) {
146146 // find city build sizes
147- sint16 max_size = max ( desc->get_x (), desc-> get_y () );
148- if (max_size > 3 ) {
149- dbg->fatal (" hausbauer_t::successfully_loaded()" , " maximum city building size (3x3) but %s is (%sx %i)" , desc->get_name (), desc->get_x (), desc->get_y ());
147+ sint16 max_size = desc->get_area ( );
148+ if (max_size > 9 ) {
149+ dbg->warning (" hausbauer_t::successfully_loaded()" , " maximum city building size (3x3) but %s is (%ix %i)" , desc->get_name (), desc->get_x (), desc->get_y ());
150150 }
151- if (largest_city_building_area < max_size) {
151+ else if (largest_city_building_area < max_size) {
152+ dbg->message (" hausbauer_t::successfully_loaded()" , " maximum city building size %s is (%ix%i)" , desc->get_name (), desc->get_x (), desc->get_y ());
152153 largest_city_building_area = max_size;
153154 }
154155 }
@@ -484,7 +485,8 @@ gebaeude_t* hausbauer_t::build(player_t* player, koord pos, int org_layout, cons
484485 }
485486 }
486487 // now build it
487- return city->build_city_house (koord3d (pos, base_height), desc, layout);
488+ vector_tpl<const building_desc_t *>ex;
489+ return city->build_city_house (koord3d (pos, base_height), desc, layout, 0 , &ex);
488490 }
489491
490492 sint8 base_h = -128 ;
@@ -885,7 +887,7 @@ const building_desc_t* hausbauer_t::get_special(uint32 bev, building_desc_t::bty
885887 * @param start_level the minimum level of the house/station
886888 * @param cl allowed climates
887889 */
888- static const building_desc_t * get_city_building_from_list (const vector_tpl<const building_desc_t *>& list, int start_level, uint16 time, climate cl, uint32 clusters, koord minsize, koord maxsize, vector_tpl<const building_desc_t *>* exclude )
890+ static const building_desc_t * get_city_building_from_list (const vector_tpl<const building_desc_t *>& list, int start_level, uint16 time, climate cl, uint32 clusters, sint16 minsize, sint16 maxsize, vector_tpl<const building_desc_t *>* exclude )
889891{
890892 weighted_vector_tpl<const building_desc_t *> selections (16 );
891893 int level = start_level;
@@ -908,10 +910,8 @@ static const building_desc_t* get_city_building_from_list(const vector_tpl<const
908910 desc->get_distribution_weight () > 0 &&
909911 desc->is_available (time) &&
910912 // size check
911- ( (desc->get_x () <= maxsize.x && desc->get_y () <= maxsize.y &&
912- desc->get_x () >= minsize.x && desc->get_y () >= minsize.y ) ||
913- (desc->get_x () <= maxsize.y && desc->get_y () <= maxsize.x &&
914- desc->get_x () >= minsize.y && desc->get_y () >= minsize.x ) ) ) {
913+ (desc->get_area ()>=minsize && desc->get_area () <= maxsize)
914+ ) {
915915 desc_at_least = desc;
916916 if ( thislevel == level ) {
917917 if (!exclude || !exclude->is_contained (desc)) {
@@ -948,19 +948,19 @@ static const building_desc_t* get_city_building_from_list(const vector_tpl<const
948948}
949949
950950
951- const building_desc_t * hausbauer_t::get_commercial (int level, uint16 time, climate cl, uint32 clusters, koord minsize, koord maxsize, vector_tpl<const building_desc_t *>* exclude)
951+ const building_desc_t * hausbauer_t::get_commercial (int level, uint16 time, climate cl, uint32 clusters, sint16 minsize, sint16 maxsize, vector_tpl<const building_desc_t *>* exclude)
952952{
953953 return get_city_building_from_list (city_commercial, level, time, cl, clusters, minsize, maxsize, exclude );
954954}
955955
956956
957- const building_desc_t * hausbauer_t::get_industrial (int level, uint16 time, climate cl, uint32 clusters, koord minsize, koord maxsize, vector_tpl<const building_desc_t *>* exclude)
957+ const building_desc_t * hausbauer_t::get_industrial (int level, uint16 time, climate cl, uint32 clusters, sint16 minsize, sint16 maxsize, vector_tpl<const building_desc_t *>* exclude)
958958{
959959 return get_city_building_from_list (city_industry, level, time, cl, clusters, minsize, maxsize, exclude );
960960}
961961
962962
963- const building_desc_t * hausbauer_t::get_residential (int level, uint16 time, climate cl, uint32 clusters, koord minsize, koord maxsize, vector_tpl<const building_desc_t *> *exclude)
963+ const building_desc_t * hausbauer_t::get_residential (int level, uint16 time, climate cl, uint32 clusters, sint16 minsize, sint16 maxsize, vector_tpl<const building_desc_t *> *exclude)
964964{
965965 return get_city_building_from_list (city_residential, level, time, cl, clusters, minsize, maxsize, exclude );
966966}
0 commit comments