src/roadveh_cmd.cpp
branchnoai
changeset 10370 fa4f88090694
parent 10294 7798ae816af8
child 10455 22c441f5adf9
equal deleted inserted replaced
10362:7fb36b849909 10370:fa4f88090694
  2018 {
  2018 {
  2019 	Vehicle *v;
  2019 	Vehicle *v;
  2020 
  2020 
  2021 	FOR_ALL_VEHICLES(v) {
  2021 	FOR_ALL_VEHICLES(v) {
  2022 		if (v->type == VEH_ROAD) {
  2022 		if (v->type == VEH_ROAD) {
       
  2023 			if (v->age >= 730 && v->GetDisplayProfitThisYear() < 0) {
       
  2024 				AI_Event(v->owner, new AIEventVehicleUnprofitable(v->index));
       
  2025 			}
  2023 			v->profit_last_year = v->profit_this_year;
  2026 			v->profit_last_year = v->profit_this_year;
  2024 			v->profit_this_year = 0;
  2027 			v->profit_this_year = 0;
  2025 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
  2028 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
  2026 		}
  2029 		}
  2027 	}
  2030 	}