Commit Graph

527 Commits (fe2bcd2a583fd02416ca394062f8f53bacf0722d)

Author SHA1 Message Date
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Jonathan G Rennison 10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
1 year ago
SamuXarick b7abaa55a3
Codechange: Improve performance when calculating company value (#9901) 2 years ago
glx22 aeeee9f18e Fix #9909, 13528bf: Left-over unused parameter breaks overload resolution 2 years ago
benda 6540948ace
Fix: Company values do not properly account for shares (#9770)
Co-authored-by: Charles Pigott <charlespigott@googlemail.com>
2 years ago
Charles Pigott 146827c458
Fix #9877: GS could trigger 'Cost: 0' cost message (#9878) 2 years ago
Tyler Trahan f4ca94d3f6 Codechange: Revenue is not the same as Income
Income is revenue minus costs. Let's name things correctly (without breaking the script API).
2 years ago
Tyler Trahan d220debc6c
Change: Don't pay Property Maintenance on stations when Infrastructure Maintenance is disabled (#9828) 2 years ago
Rubidium c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 2 years ago
Rubidium 1c256a4be7 Fix: do not let shares in the company taking over another company disappear 2 years ago
dP 36bee83864
Change: Deliver cargo to the closest industry first (#9536) 2 years ago
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 2 years ago
Michael Lutz 2e39637db2 Codechange: Don't use a global for the 'not enough cash' message. 3 years ago
Michael Lutz 41fa16f325 Codechange: Don't use globals for return values from vehicle command procs. 3 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 3 years ago
Michael Lutz 21675ec7e2 Codechange: Un-bitstuff vehicle/engine commands. 3 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 3 years ago
Michael Lutz 0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 3 years ago
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
3 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 3 years ago
Rubidium d83647f9a7 Fix #9440: negative cargo payments not being handled right
Cargo payments were stored as unsigned integer, but cast to int64 during
application of inflation. However, then being multiplied with a uint64
making the result uint64. So in the end the payment that should have been
negative becomes hugely positive.
3 years ago
glx22 a543a4b7bb Codechange: Remove FOR_EACH_SET_CARGO_ID 3 years ago
rubidium42 9a7750f14e Codechange: use the constructor for CompanyNewsItem to fill the data instead of a separate function 3 years ago
rubidium42 aa9818db90 Codechange: create a type for the "free_data" of NewsItems and (de)allocate it with new and delete 3 years ago
Patric Stout ef25afd55a
Fix #9348, 4d74e51: don't try to sell shares of spectators (#9349)
"new_owner" can be INVALID_OWNER, and as INVALID_OWNER ==
COMPANY_SPECTATORS, we could end up trying to sell shares of
nobody.
3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 3 years ago
Patric Stout 4d74e51907
Fix #9281: acquire a company uses special bookkeeping to make you rich (#9300)
When you buy-out a company, you got your shares back. This is
based on company-value, which includes values for the vehicles etc.
In other words, you not only got the vehicles, but you also got
paid to get them back.

Additionally, you also got the loan of the company, but not the
money for the loan (as that is subtracted from the company-value).

Solve this by changing the rules of a buy-out: don't sell your
shares, get the loan AND the balance and get the infrastructure.
3 years ago
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 3 years ago
William Davis 881e1da51d
Change: Use gender-neutral pronouns in console command messages (and comments) (#9203) 3 years ago
glx22 9a8756d7ed Codechange: Replace FOR_ALL_CARGOSPECS with range-based for loops 3 years ago
glx22 6b8ad5a9b1 Change: Apply some consistency to singleplayer related comments 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 4 years ago
Michael Lutz 79cb9efa7f
Change: Always apply inflation from 1920 to 2090, no matter the game start year. (#7589) 4 years ago
Pavel Stupnikov 9a45a0f535
Feature: Set exclusive access to industry from GS (#8115) 4 years ago
Pavel Stupnikov b2895dfcd0
Change: extend the allowed range for max loan setting (#8386) 4 years ago
Jonathan G Rennison 2fee030a26 Change: Algorithm for transfer feeder payments
The original algorithm pays intermediate legs in feeder systems based
on the start and end stations of that particular leg.
This tends to result in large negative payments on the final leg for
journeys with many feeder legs, as the overall feeder payment increases
with the number of legs, and the final leg is penalised for discrepancies
between the previous leg payments and the actual payment for delivery
from the source to the destination.
The feeder share setting is a partial mitigation, however it is difficult
to tune as a suitable value depends on the number of legs and the network
topology, which are often not the same for all vehicles.

The new incremental algorithm pays the cargo payment from the source
station to the end station of the current leg, minus any previous
transfer feeder payments for each leg.
This prevents unbounded increase of feeder payments and therefore avoids
the issue of excessive negative payments on the final leg.
Feeder payments may be negative, e.g. in the case of poorly performing
or highly indirect legs. This is better than penalising the final leg.
This mode reduces the need to tune the feeder shares setting to the
current network.

The feeder share setting applies in the existing way.
4 years ago
Mingwei Samuel 26ce4eb45d Fix #7430: when train visits station, only reset time_since_pickup if has room to load 5 years ago
glx ee7a8eebca Codechange: Replace FOR_ALL_TOWNS with range-based for loops 5 years ago
glx 0b489f9924 Codechange: Replace FOR_ALL_SUBSIDIES with range-based for loops 5 years ago
glx 847e5f33d4 Codechange: Replace story related FOR_ALL with range-based for loops 5 years ago
glx 869581eb23 Codechange: Replace FOR_ALL_SIGNS with range-based for loops 5 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
glx 4ae829cb27 Codechange: Replace FOR_ALL_GROUPS with range-based for loops 5 years ago
glx f58ce3db19 Codechange: Replace FOR_ALL_GOALS with range-based for loops 5 years ago