Add setting for transfer payment mode from source, minus transfers.

This is to reduce large negative payments for the final leg.
pull/18/head
Jonathan G Rennison 7 years ago
parent 56013d3b91
commit 5a2fe49457

@ -1242,11 +1242,13 @@ void CargoPayment::PayFinalDelivery(const CargoPacket *cp, uint count)
/* Handle end of route payment */
Money profit = DeliverGoods(count, this->ct, this->current_station, cp->SourceStationXY(), cp->DaysInTransit(), this->owner, cp->SourceSubsidyType(), cp->SourceSubsidyID());
profit -= cp->FeederShare(count);
/* For Infrastructure patch. Handling transfers between other companies */
this->route_profit += profit - cp->FeederShare(count);
this->route_profit += profit;
/* The vehicle's profit is whatever route profit there is minus feeder shares. */
this->visual_profit += profit - cp->FeederShare(count);
this->visual_profit += profit;
}
/**
@ -1260,10 +1262,12 @@ Money CargoPayment::PayTransfer(const CargoPacket *cp, uint count)
Money profit = GetTransportedGoodsIncome(
count,
/* pay transfer vehicle for only the part of transfer it has done: ie. cargo_loaded_at_xy to here */
DistanceManhattan(cp->LoadedAtXY(), Station::Get(this->current_station)->xy),
DistanceManhattan(_settings_game.economy.feeder_payment_src_station ? cp->SourceStationXY() : cp->LoadedAtXY(), Station::Get(this->current_station)->xy),
cp->DaysInTransit(),
this->ct);
if (_settings_game.economy.feeder_payment_src_station) profit -= cp->FeederShare(count);
profit = profit * _settings_game.economy.feeder_payment_share / 100;
/* For Infrastructure patch. Handling transfers between other companies */

@ -1630,6 +1630,8 @@ STR_CONFIG_SETTING_ALLOW_SHARES :Allow buying sh
STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :When enabled, allow buying and selling of company shares. Shares will only be available for companies reaching a certain age
STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Percentage of leg profit to pay in feeder systems: {STRING2}
STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :Percentage of income given to the intermediate legs in feeder systems, giving more control over the income
STR_CONFIG_SETTING_FEEDER_PAYMENT_SRC_STATION :Calculate leg profit relative to source station in feeder systems: {STRING2}
STR_CONFIG_SETTING_FEEDER_PAYMENT_SRC_STATION_HELPTEXT :When enabled, the calculation of leg profit in feeder systems is from the source station to the current point, minus any previous transfer payments, instead of calculating the current leg profit as an independent journey
STR_CONFIG_SETTING_SIMULATE_SIGNALS :Simulate signals in tunnels, bridges every: {STRING2}
STR_CONFIG_SETTING_SIMULATE_SIGNALS_VALUE :{COMMA} tile{P 0 "" s}
STR_CONFIG_SETTING_DAY_LENGTH_FACTOR :Day length factor: {STRING2}

@ -1660,6 +1660,7 @@ static SettingsContainer &GetSettingsTree()
accounting->Add(new SettingEntry("difficulty.max_loan"));
accounting->Add(new SettingEntry("difficulty.subsidy_multiplier"));
accounting->Add(new SettingEntry("economy.feeder_payment_share"));
accounting->Add(new SettingEntry("economy.feeder_payment_src_station"));
accounting->Add(new SettingEntry("economy.infrastructure_maintenance"));
accounting->Add(new SettingEntry("difficulty.vehicle_costs"));
accounting->Add(new SettingEntry("difficulty.construction_cost"));

@ -529,6 +529,7 @@ struct EconomySettings {
bool smooth_economy; ///< smooth economy
bool allow_shares; ///< allow the buying/selling of shares
uint8 feeder_payment_share; ///< percentage of leg payment to virtually pay in feeder systems
bool feeder_payment_src_station; ///< calculate leg payment relative to the source station, not the leg source
byte dist_local_authority; ///< distance for town local authority, default 20
bool exclusive_rights; ///< allow buying exclusive rights
bool fund_buildings; ///< allow funding new buildings

@ -1653,6 +1653,15 @@ strhelp = STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT
strval = STR_CONFIG_SETTING_PERCENTAGE
cat = SC_EXPERT
[SDT_BOOL]
base = GameSettings
var = economy.feeder_payment_src_station
def = false
str = STR_CONFIG_SETTING_FEEDER_PAYMENT_SRC_STATION
strhelp = STR_CONFIG_SETTING_FEEDER_PAYMENT_SRC_STATION_HELPTEXT
cat = SC_EXPERT
patxname = ""economy.feeder_payment_src_station""
[SDT_XREF]
xref = ""economy.day_length_factor""
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_SPRINGPP)

Loading…
Cancel
Save