File diff r12404:d58b2d050240 → r12405:ba094e765533
src/economy.cpp
Show inline comments
 
@@ -830,13 +830,13 @@ void StartupEconomy()
 
void ResetEconomy()
 
{
 
	/* Test if resetting the economy is needed. */
 
	bool needed = false;
 

	
 
	for (CargoID c = 0; c < NUM_CARGO; c++) {
 
		const CargoSpec *cs = GetCargo(c);
 
		const CargoSpec *cs = CargoSpec::Get(c);
 
		if (!cs->IsValid()) continue;
 
		if (_cargo_payment_rates[c] == 0) {
 
			needed = true;
 
			break;
 
		}
 
	}
 
@@ -863,13 +863,13 @@ Money GetPriceByIndex(uint8 index)
 

	
 
	return ((Money*)&_price)[index];
 
}
 

	
 
Money GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type)
 
{
 
	const CargoSpec *cs = GetCargo(cargo_type);
 
	const CargoSpec *cs = CargoSpec::Get(cargo_type);
 

	
 
	/* Use callback to calculate cargo profit, if available */
 
	if (HasBit(cs->callback_mask, CBM_CARGO_PROFIT_CALC)) {
 
		uint32 var18 = min(dist, 0xFFFF) | (min(num_pieces, 0xFF) << 16) | (transit_days << 24);
 
		uint16 callback = GetCargoCallback(CBID_CARGO_PROFIT_CALC, 0, var18, cs);
 
		if (callback != CALLBACK_FAILED) {
 
@@ -1086,13 +1086,13 @@ static Money DeliverGoods(int num_pieces
 

	
 
		/* Check if a subsidy applies. */
 
		subsidised = CheckSubsidised(s_from, s_to, cargo_type, company->index);
 
	}
 

	
 
	/* Increase town's counter for some special goods types */
 
	const CargoSpec *cs = GetCargo(cargo_type);
 
	const CargoSpec *cs = CargoSpec::Get(cargo_type);
 
	if (cs->town_effect == TE_FOOD) s_to->town->new_act_food += num_pieces;
 
	if (cs->town_effect == TE_WATER) s_to->town->new_act_water += num_pieces;
 

	
 
	/* Give the goods to the industry. */
 
	DeliverGoodsToIndustry(s_to, cargo_type, num_pieces);