Prior to this change, the use of NewObjects often lead to the problem of players trying to clear those and accidentally destroying a rail station or (when using magic bulldozer) an industry. This action cannot be undone.
This change shows a query making sure the player actually wants to destroy the station or industry.
NOTE: The switch to a std::function no longer allows for the inequality check in ShowQuery in misc_gui. If this was required a different solution has to be found.
"new_owner" can be INVALID_OWNER, and as INVALID_OWNER ==
COMPANY_SPECTATORS, we could end up trying to sell shares of
nobody.
(cherry picked from commit ef25afd55a)
Prior to this change, the charts were pretty useless. They indicated at most what cargos were speed sensitive and which ones were not.
This change lets the graph show the average transit speed to profit mapping. With this graph it becomes obvious after exactly what speed any further speed increase brings no further profit. This makes train selection way easier.
YAPF could end up in a situation where it sets the best intermediate node
to a node whose construction is never finalized (i.e. it is never added to
the open list). The content of the node would be overwritten in the next
round, potentially sending the vehicle to an unwanted location.
(cherry picked from commit 0125ba82e8)
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.
(cherry picked from commit 4d74e51907)
The function fluid_player_join in the library is broken beyond compare for the
usecases it was used for (see their #872). It does not wait until it is safe
to delete the player, so it is up to the end user to ensure that.
For OpenTTD we acquire a lock before fluid_synth_write_s16 and we acquire the
same lock in the stop function. So, only one of the functions can be doing its
thing, meaning we do not need to wait for the player to be stopped as it
cannot be doing anything as we prevent that by the lock.
(cherry picked from commit 79fc094c54)
Since pixel dimensions in SetPadding() are scaled by GUI size, padding for inset viewports was excessive.
Instead, automatically apply padding for WWT_INSET at widget level. This applies to all widgets inside a WWT_INSET, which in all instances is a NWID_VIEWPORT.
(cherry picked from commit 330a305c99)