File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,16 @@ int building_find(building_type type)
117117 return 0 ;
118118}
119119
120+ int building_find_with_mothballed (building_type type )
121+ {
122+ for (building * b = data .first_of_type [type ]; b ; b = b -> next_of_type ) {
123+ if (b -> state == BUILDING_STATE_IN_USE || b -> state == BUILDING_STATE_MOTHBALLED ) {
124+ return b -> id ;
125+ }
126+ }
127+ return 0 ;
128+ }
129+
120130building * building_first_of_type (building_type type )
121131{
122132 return data .first_of_type [type ];
Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ int building_count(void);
216216
217217int building_find (building_type type );
218218
219+ int building_find_with_mothballed (building_type type );
220+
219221int building_can_repair_type (building_type type );
220222
221223building * building_first_of_type (building_type type );
Original file line number Diff line number Diff line change @@ -543,7 +543,7 @@ static int house_consume_food(void)
543543static int mess_hall_consume_food (void )
544544{
545545 int total_consumed = 0 ;
546- building * b = building_get (building_find (BUILDING_MESS_HALL ));
546+ building * b = building_get (building_find_with_mothballed (BUILDING_MESS_HALL ));
547547 if (!b || (b -> state != BUILDING_STATE_IN_USE && b -> state != BUILDING_STATE_MOTHBALLED )) {
548548 return 0 ;
549549 }
You can’t perform that action at this time.
0 commit comments