File diff r8555:63e19bfda16e → r8556:c5860d29500d
src/economy.cpp
Show inline comments
 
@@ -160,17 +160,15 @@ int UpdateCompanyRatingAndValue(Player *
 
		FOR_ALL_VEHICLES(v) {
 
			if (v->owner != owner) continue;
 
			if (IsPlayerBuildableVehicleType(v->type) && v->IsPrimaryVehicle()) {
 
				num++;
 
				if (v->age > 730) {
 
					/* Find the vehicle with the lowest amount of profit */
 
					if (min_profit_first == true) {
 
						min_profit = v->profit_last_year;
 
					if (min_profit_first || min_profit > v->profit_last_year >> 8) {
 
						min_profit = v->profit_last_year >> 8;
 
						min_profit_first = false;
 
					} else if (min_profit > v->profit_last_year) {
 
						min_profit = v->profit_last_year;
 
					}
 
				}
 
			}
 
		}
 

	
 
		_score_part[owner][SCORE_VEHICLES] = num;
 
@@ -1502,13 +1500,13 @@ void VehiclePayment(Vehicle *front_v)
 
						cp->count,
 
						/* pay transfer vehicle for only the part of transfer it has done: ie. cargo_loaded_at_xy to here */
 
						DistanceManhattan(cp->loaded_at_xy, GetStation(last_visited)->xy),
 
						cp->days_in_transit,
 
						v->cargo_type);
 

	
 
					front_v->profit_this_year += profit;
 
					front_v->profit_this_year += profit << 8;
 
					virtual_profit   += profit; // accumulate transfer profits for whole vehicle
 
					cp->feeder_share += profit; // account for the (virtual) profit already made for the cargo packet
 
					cp->paid_for      = true;   // record that the cargo has been paid for to eliminate double counting
 
				}
 
				result |= 2;
 

	
 
@@ -1520,13 +1518,13 @@ void VehiclePayment(Vehicle *front_v)
 

	
 
	if (virtual_profit > 0) {
 
		ShowFeederIncomeAnimation(front_v->x_pos, front_v->y_pos, front_v->z_pos, virtual_profit);
 
	}
 

	
 
	if (route_profit != 0) {
 
		front_v->profit_this_year += vehicle_profit;
 
		front_v->profit_this_year += vehicle_profit << 8;
 
		SubtractMoneyFromPlayer(CommandCost(front_v->GetExpenseType(true), -route_profit));
 

	
 
		if (IsLocalPlayer() && !PlayVehicleSound(front_v, VSE_LOAD_UNLOAD)) {
 
			SndPlayVehicleFx(SND_14_CASHTILL, front_v);
 
		}