Commit Graph

18184 Commits

Author SHA1 Message Date
glx22 5a4d5f03b0 Codechange: Implement a constructor for CurrencySpec 2021-02-13 17:31:57 +01:00
Johannes E. Krause 3ac43582c2 Codechange: [NewGRF] Make it more explicit which parts of the TTD vehicle structure (var 80+) are not implemented 2021-02-13 16:07:23 +00:00
translators fa0704138d Update: Translations from eints
spanish (mexican): 7 changes by absay
dutch: 7 changes by Afoklala
french: 7 changes by arikover
2021-02-12 19:00:59 +00:00
Patric Stout 52317bb7df Change: [SDL2] Remove unneeded delay of redrawing the screen
In testing, I could find no reason why this statement is here.

The comment is rather unclear (it states what it does, but not
why it would be needed).

This line of code was introduced with f4f40448, which gives no
further insight on why it would be needed to have it here.

As such, let's remove it and see if anyone else reports any
problems with it. If so, this commit can be reverted and a more
clear comment should be added what this line of code is dealing
with (the WHY, not the WHAT).
2021-02-11 20:23:53 +01:00
Patric Stout 2e1535389a Codechange: [SDL2] Don't use globals if we can do with locals 2021-02-11 20:23:53 +01:00
Patric Stout 2bbef6b5cf Codechange: [SDL2] Name paint function Paint(), like other drivers do
This reduces confusion when reading different drivers.
2021-02-11 20:23:53 +01:00
Patric Stout 569ce6c7b4 Fix 30e69c51: palette was not marked dirty when creating a new
This means the code depended that the caller did this for us
before MakePalette() is executed, which is neither a
requirement nor a promise the code makes.
2021-02-11 20:23:53 +01:00
translators 64e2d6b672 Update: Translations from eints
korean: 7 changes by telk5093
russian: 11 changes by Ln-Wolf
finnish: 7 changes by hpiirai
2021-02-11 19:01:10 +00:00
Kuhnovic 83ddb1501f
Feature: Remove all industries button in scenario editor (#8550) 2021-02-10 16:35:50 +01:00
Loïc Guilloux f1f281b318
Fix: [Win32] Set minimum resolution for timers to 1ms. (#8660) 2021-02-09 21:21:57 +01:00
embeddedt 6c8f2227cd
Fix: [Emscripten] open links in browser (#8655) 2021-02-08 19:18:30 +01:00
Patric Stout ac2b5e57cf
Fix: mention our websites with https:// (instead of http://) (#8657)
It is 2021. Nobody should advertise http anymore. Not even us.
2021-02-08 19:07:34 +01:00
glx22 2cbfcd2327 Change: [CMake] Bump minimum version to 3.9 2021-02-07 16:21:13 +01:00
Loïc Guilloux b927da73c1
Fix 81d335b081: Use non-pulsating red highlight for coverage (#8622) 2021-02-07 16:20:26 +01:00
Matt Kimber 2a6da319b2
Fix 0125892: Don't crash when towns upgrade road tiles during expansion (#8651) 2021-02-07 16:15:46 +01:00
Patric Stout 2c9084d48c
Fix #8029: [SDL2] disable draw-thread on wayland SDL video driver (#8648)
When the wayland SDL video driver is used, an EGL context is
created in the main thread. It is not allowed to update this
context from another thread, which is exactly what our draw-thread
is trying.

The other solution would be to move all of SDL into the
draw-thread, but that would introduce a whole scala of different
problems.

The wayland SDL backend is significantly faster than the
X11 SDL backend, but there is a performance hit nevertheless.
2021-02-06 14:09:45 +01:00
SamuXarick a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
2021-02-05 11:00:36 +01:00
translators 5b3fe4ae27 Update: Translations from eints
german: 4 changes by Wuzzy2
2021-02-02 18:17:17 +00:00
glx22 144991990e Fix: [CMake] Language files should depend on english.txt 2021-02-02 17:33:18 +01:00
translators 696b6990ea Update: Translations from eints
estonian: 110 changes by siimsoni
2021-02-01 18:17:06 +00:00
translators 069fb54253 Update: Translations from eints
estonian: 17 changes by siimsoni
german: 410 changes by Wuzzy2
2021-01-31 18:14:37 +00:00
Patric Stout 7fbf705c41
Fix 2db88953: default Network Server List sorter put compatible servers in wrong order (#8626)
If a server is compatible, it falls back to sorting by clients.
This used to be in reverse, so full servers are on top. With
the codechange commit, this was removed by accident, and as
such empty servers were on top. This is silly.
2021-01-31 10:36:07 +01:00
Tyler Trahan 1dda7d6486
Fix: don't walk out of the map when trying to build tunnels (#8600) 2021-01-31 10:04:22 +01:00
Patric Stout 0e54c32452 Codechange: [SDL2] Use MakeDirty() to force a redraw
The original code is "strictly correct", but just reads really
weird, and we use MakeDirty() in several other places instead too.
2021-01-30 21:43:59 +01:00
Patric Stout 30e69c518b Codechange: [SDL2] Rework how palette is updated
It now follows more what the Win32 driver does, and has far less
exceptions and special casing.

MakePalette creates the Palette and prepares surface.
UpdatePalette updates the Palette.
CheckPaletteAnim checks if UpdatePalette needs to be called and
  marks the whole screen dirty so DrawSurfaceToScreen will do a
  full redraw.
2021-01-30 21:43:59 +01:00
Patric Stout eb80fefd1d Fix: [SDL2] Display why SDL_CreateWindow() failed in case it does
All SDL_NNN errors print SDL_GetError, except for this one place.
2021-01-30 21:43:59 +01:00
Patric Stout 19345908cb Codechange: [SDL2] Split away CreateMainWindow from CreateMainSurface
This makes the code a bit more readable, as both intentions are
more clear, and there is less nesting in the main function.
2021-01-30 21:43:59 +01:00
Patric Stout 8c37e5c526 Codechange: [SDL2] reworked the different surfaces to make it more readable 2021-01-30 21:43:59 +01:00
Patric Stout 8de325f256 Codechange: [SDL2] Only prepare "caption" if you are going to us it 2021-01-30 21:43:59 +01:00
Patric Stout e41ec5b42e Codechange: [SDL2] Minor code cleanup to remove silly variable 2021-01-30 21:43:59 +01:00
Patric Stout 678031f9b3 Codechange: [SDL2] Only set _cur_palette, never _local_palette 2021-01-30 21:43:59 +01:00
Patric Stout f31b65825f Codechange: [SDL2] Move FindStartupDisplay to its own function 2021-01-30 21:43:59 +01:00
Patric Stout 6916fc76bd Codechange: [SDL2] reworked FindResolutions to be more like the rest
There was no default resolution fallback, and the code was different
from the win32 driver. It is now named the same and much more
similar.
2021-01-30 21:43:59 +01:00
Patric Stout a52d716c88 Codechange: [SDL2] remove include-protection
This is already done by CMake: if SDL2 is not detected, this file
is not included.
2021-01-30 21:43:59 +01:00
translators 5ae2c1552b Update: Translations from eints
estonian: 353 changes by siimsoni
2021-01-30 18:14:36 +00:00
translators 48698403a8 Update: Translations from eints
estonian: 85 changes by siimsoni
korean: 30 changes by telk5093
portuguese: 24 changes by CheapWebdesign
2021-01-29 18:17:44 +00:00
translators 3dac139b00 Update: Translations from eints
estonian: 5 changes by siimsoni
hungarian: 7 changes by andrejmoltok
2021-01-28 18:16:32 +00:00
translators da78b5c130 Update: Translations from eints
estonian: 117 changes by siimsoni
german: 5 changes by Wuzzy2
slovak: 23 changes by FuryPapaya
2021-01-27 18:14:58 +00:00
translators 027452fef8 Update: Translations from eints
german: 11 changes by Wuzzy2
2021-01-26 18:14:06 +00:00
translators 67fa5a23b9 Update: Translations from eints
estonian: 7 changes by siimsoni
2021-01-25 18:42:15 +00:00
translators b2d9a2dc79 Update: Translations from eints
estonian: 12 changes by siimsoni
finnish: 1 change by hpiirai
2021-01-23 18:39:34 +00:00
glx22 6b8ad5a9b1 Change: Apply some consistency to singleplayer related comments 2021-01-22 22:19:55 +01:00
glx22 07385c3662 Fix: Use the same safety checks as 'stop_ai' for 'reload_ai' 2021-01-22 22:19:55 +01:00
glx22 485aafc1b7 Fix: Never delete the last existing company in singleplayer mode 2021-01-22 22:19:55 +01:00
dP b17177bd20 Fix: Center text and image in vehicle statusbar vertically 2021-01-22 22:18:17 +01:00
translators 8fe79e153d Update: Translations from eints
estonian: 8 changes by siimsoni
german: 89 changes by Wuzzy2
finnish: 2 changes by hpiirai
dutch: 27 changes by Afoklala
2021-01-22 18:43:56 +00:00
dP bab7de6cf2 Feature: Allow GameScripts to add additional text to Industry view window 2021-01-22 09:50:53 +00:00
Pavel Stupnikov 4b42ecb0f6
Feature: Add tile parameter for GSCompany.ChangeBankBalance to show text effect if needed (#8573) 2021-01-22 10:28:26 +01:00
translators 33e27e9480 Update: Translations from eints
estonian: 15 changes by siimsoni
russian: 23 changes by Ln-Wolf
2021-01-21 18:42:13 +00:00
translators 6e1581a17d Update: Translations from eints
german: 2 changes by Wuzzy2
russian: 13 changes by Ln-Wolf
2021-01-20 18:44:27 +00:00
translators 27caabdb91 Update: Translations from eints
german: 23 changes by Wuzzy2
russian: 70 changes by Ln-Wolf
2021-01-19 18:41:55 +00:00
frosch b3d048dfcf
Change: [NewGRF] industry special flag 19 now specifically targets only passenger production, instead of the second cargo of any water-based industry. (#8590)
This behavior is less surprising to NewGRF authors, and may even be intentional behavior for some industries.
2021-01-18 22:42:10 +01:00
Michael Lutz 7da224d29d
Fix #8589, 653e7fa548: Motion counter is NewGRF-visible but not saved, leading to desyncs. (#8591) 2021-01-18 21:11:38 +01:00
Owen Rudge 6d95ed53dc Feature: Add support for rdtsc for ARM-based Windows (MSVC) 2021-01-18 08:57:58 +00:00
Patric Stout 1eceee915e Codechange: [SDL2/Win32] Be consistent how 0bpp blitters are not allowed
Sometimes it returned an usererror(), sometimes Start() failed.
Now it always fails on Start(), so nothing else has to check again
what blitter is used.

AfterBlitterChange() can never change to a 0bpp, so it is sufficient
to guard this with an assert().
2021-01-17 19:57:36 +01:00
Patric Stout 49df9c4155 Codechange: [Win32] Use _local_palette for most operations
Other drivers do this too, and this makes the world a bit more
the same.
2021-01-17 19:57:36 +01:00
Patric Stout 881d17d8f1 Codechange: [Win32] use CSleep() instead of Sleep() like everywhere else
Functional it is identical. Just helps future-us when searching
for sleeps.
2021-01-17 19:57:36 +01:00
Patric Stout 689404a4a1 Codechange: [Win32] Use return-early in RegisterWndClass() 2021-01-17 19:57:36 +01:00
Michael Lutz 7415964a4d Codechange: [Win32] Remove Windows 95 specific mouse tracking work-around. 2021-01-17 19:57:36 +01:00
Matt Kimber 40d5fe1631
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540) 2021-01-17 19:57:16 +01:00
translators 120c6fda61 Update: Translations from eints
catalan: 11 changes by J0anJosep
2021-01-17 18:39:39 +00:00
frosch 540fdfbf5a
Fix 0e62a398c7f: Only center the window, when it is smaller than the screen. (#8581) 2021-01-16 23:36:15 +01:00
translators c91a7b5e2e Update: Translations from eints
norwegian (bokmal): 65 changes by fnutt
french: 1 change by glx22
2021-01-16 18:40:42 +00:00
frosch 0e62a398c7
Add: [SDL2] video driver parameter to put OpenTTD on a particular display on start. By default use the display where the mouse cursor is. (#8572) 2021-01-14 23:29:29 +01:00
Michael Lutz fa60c1f8b9
Feature: Choose a sensible window size on a fresh OTTD config file. (#8536) 2021-01-14 21:53:06 +01:00
translators 711723d738 Update: Translations from eints
norwegian (bokmal): 10 changes by buzzCraft
spanish (mexican): 7 changes by absay
korean: 1 change by telk5093
indonesian: 30 changes by dimaspaf14
finnish: 1 change by hpiirai
catalan: 2 changes by gerardnll
portuguese (brazilian): 4 changes by AKANexus
polish: 1 change by yazalo
2021-01-14 18:44:37 +00:00
glx22 86818e5ae8
Fix #7670: prevent useless pathfinder run for blocked vehicles 2021-01-14 18:41:38 +01:00
Jonathan G Rennison 1411f878ab
Add: Console command to dump debugging information (#8548) 2021-01-13 21:16:47 +01:00
translators b99eafbfb0 Update: Translations from eints
korean: 14 changes by telk5093
finnish: 1 change by hpiirai
spanish: 41 changes by MontyMontana
polish: 5 changes by yazalo
2021-01-13 18:48:46 +00:00
Charles Pigott ebaecebc68 Fix #8560: Planes were landing at the wrong height at airports with lowered hangar tiles 2021-01-13 16:41:30 +00:00
SamuXarick f9dee5aaa0 Feature: Show rainforest under vegetation on small map 2021-01-13 15:05:15 +00:00
Patric Stout de44ce2092
Change: darken the background of all graph to increase contrast (#8557)
Now lines like Mauve, Dark Green and Purple are much more visible
without hurting the other colours.
2021-01-13 14:55:55 +01:00
Patric Stout c6fd6cfd15 Fix: tell the user if a font fails to load and fallback is about to be used
Additionally, tell exactly why the font failed to load, which
glyph was missing from the font. This hopefully helps the user
a bit more in the right direction.
2021-01-13 14:27:39 +01:00
Patric Stout 98400974a9 Codechange: nobody was using "str" parameter, so remove it 2021-01-13 14:27:39 +01:00
translators 57c45a2c01 Update: Translations from eints
spanish (mexican): 64 changes by absay
indonesian: 7 changes by dimaspaf14
finnish: 94 changes by hpiirai
slovak: 25 changes by gpalino
french: 11 changes by glx22
polish: 11 changes by yazalo
2021-01-12 18:38:08 +00:00
translators 3e7c757398 Update: Translations from eints
spanish (mexican): 1 change by absay
2021-01-11 21:23:47 +00:00
frosch e339188ded Add: a go-to-location button to the LandInfo window. 2021-01-11 22:15:58 +01:00
frosch 1432dbac53 Add: another go-to-location button to the sign window. 2021-01-11 22:15:58 +01:00
frosch 5bfcd742b8 Change: Relocate rename and location buttons in all windows. 2021-01-11 22:15:58 +01:00
frosch 589feba0eb Change: Relocate vehicle rename and location buttons. 2021-01-11 22:15:58 +01:00
frosch 8dda0ec4ff Add: [NewGRF] new GUI sprites for 'rename' and 'go to location'. 2021-01-11 22:15:58 +01:00
Patric Stout cd36e17160
Fix: don't allow free-wagon-chains to exceed max-train-length (#8533)
This makes no sense, that a free-wagon-chain could be larger than
the maximum length of a train, as you cannot put an engine in
front of that anyway. And it prevents run-away AIs making very
silly long free-wagon-chains.
2021-01-11 20:58:00 +01:00
Patric Stout 760b0cdc11 Change: change console command "restart" and add "reload"
The current "restart" command is now called "reload", as that is
what it does.
The old "restart" command is now called "restart", as that is what
it did.

As this has not been in any official release yet, this shouldn't
harm any kitten.
2021-01-11 20:11:08 +01:00
Patric Stout ff89f5f4c6 Fix 8f3d1ec: "restart" did not always restart your current game
In the sequence:
- Load a game
- Start a newgame (via console)
- Restart a game (via console)
Gave you the loaded game back, not the new game.
2021-01-11 20:11:08 +01:00
Patric Stout fe86bf8bf6
Fix #7619: nudge fast planes sooner towards their target (#8531)
For non-NewGRF planes, "count" is never above 1. So planes can
smoothly be guided to their destination. For NewGRF planes, they
can go as quick as "count" values of 20. This easily overshoots
the target. So, calculate if the plane will overshoot, and start
nudging him to the destination earlier. You won't notice this
either way, as it all happens within a single tick.
2021-01-11 20:10:53 +01:00
translators eb23a6921b Update: Translations from eints
arabic (egypt): 30 changes by AviationGamerX
indonesian: 30 changes by dimaspaf14
german: 12 changes by MagnumSociety
french: 5 changes by glx22
2021-01-11 18:33:36 +00:00
SamuXarick 6298d9221a Fix 218f40e: Warning about 32-bit shift implicitly converted to 64 bits 2021-01-10 22:31:01 +01:00
frosch f6abc81cf1 Fix: add missing variables to NewGRF inspect window. 2021-01-10 21:24:38 +01:00
Johannes E. Krause f1bc4d8407 Add: [NewGRF] Vehicle variable 4A now also returns, whether the current tile has catenary. 2021-01-10 21:24:38 +01:00
frosch 868d84bbfc Add: [NewGRF] vehicle variable 63 to test the tracktype of the current tile against a given tracktype. 2021-01-10 21:24:38 +01:00
frosch 5b08960560 Fix: [NewGRF] industry variables 69 to 71 did not check, whether the queried cargo is valid. 2021-01-10 21:24:38 +01:00
frosch 0078554d6a Fix: GetCargoTranslation could return out-of-bounds index for old-style NewGRF using cargo-slots. 2021-01-10 21:24:38 +01:00
translators 63288f80f3 Update: Translations from eints
korean: 1 change by telk5093
finnish: 1 change by hpiirai
polish: 5 changes by yazalo
2021-01-10 18:31:52 +00:00
glx22 1fb4ed8eef Fix: Use realtime for error message and console backlog timeouts 2021-01-10 14:07:17 +01:00
glx c0d7949d7c Fix: Don't use a timer for hundredth tick determination 2021-01-10 14:07:17 +01:00
Patric Stout 5f1154e076
Fix #8272: vehicle destination text colour when mousing over (#8543)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2021-01-09 23:43:06 +01:00
translators 928276a66e Update: Translations from eints
korean: 4 changes by telk5093
finnish: 4 changes by hpiirai
catalan: 11 changes by J0anJosep
2021-01-09 18:30:51 +00:00
Patric Stout 218f40eea2
Add: [Script] ScriptCargo::GetName, to get the human readable name of a cargo (#8544)
Of course this translates into AICargo.GetName() for AIs and
GSCargo.GetName() for GameScripts.
2021-01-09 15:15:14 +01:00
Patric Stout 3dbdb1c7e3
Change: remove warning in cheat window and reduce it to a note (#8538)
Although meant as a funny joke towards the player, our social
standards have changed since 2004, and such "jokes" are no
longer acceptable by the community as a whole.

The only value of the message is that people are informed the
information is stored in the savegame. This is mostly useful for
us, developers, as some of those cheats can have side-effects
which people report.

While at it, styled the GUI a bit better, as the way the text
was presented was odd.
2021-01-09 15:14:59 +01:00
SamuXarick 8da5cff210
Fix #8462: Don't check whether to grow a town road on water (#8471) 2021-01-09 12:18:31 +01:00
Patric Stout 8e6574dcdb
Revert 78f92130: "Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535)" (#8541)
As per https://github.com/OpenTTD/OpenTTD/pull/8535#issuecomment-757122918,
jumped the gun here.
2021-01-09 12:14:23 +01:00
Tyler Trahan b0456669c9
Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535) 2021-01-09 10:06:31 +01:00
Patric Stout b6ac5a3ab9
Fix 85a49a0d3: hotkeys were enabled outside of GM_NORMAL (#8534) 2021-01-08 23:28:46 +01:00
Patric Stout 5f591c86fe
Fix 85a49a0d: invalidate airport toolbar when new planes become available (#8532)
Otherwise if the airport button is disabled, it will remain disabled
until you close/open the toolbar again.
2021-01-08 22:34:21 +01:00
frosch 31d1968004
Fix: Start the inactivity-timeout for the content server only after the connection has been established. (#8530)
When connecting took long due to the first N resolve-addresses timing out, OpenTTD would immediately close the connection, without sending anything.
2021-01-08 20:20:54 +01:00
Patric Stout 7ba0fa4bf0
Fix af22a4f2: scenario editor doesn't have build station/depot/etc (#8529) 2021-01-08 19:48:39 +01:00
translators 0f1d338dda Update: Translations from eints
korean: 2 changes by telk5093
finnish: 2 changes by hpiirai
dutch: 49 changes by Afoklala
spanish: 16 changes by Luis45ccs
french: 7 changes by dimensi0n
polish: 2 changes by yazalo
2021-01-08 18:26:47 +00:00
Tyler Trahan b08c66a796
Fix 7bdfb38: Drive-thru road stations can be connected at either end (#8528) 2021-01-08 18:56:39 +01:00
Tyler Trahan 9c0da686da
Add: Towns can build tunnels (#8473) 2021-01-08 18:32:44 +01:00
Charles Pigott 188bf0fbc9 Change: Remove disable_unsuitable_building setting
This setting is no longer useful, as you can now always build roads,
canals, etc.
2021-01-08 16:43:51 +01:00
Charles Pigott b9f3e45af7 Cleanup: Remove unused (and mostly duplicated) function 2021-01-08 16:43:51 +01:00
Patric Stout af22a4f2cd Add: show in the tooltip of disabled toolbar buttons why they are disabled 2021-01-08 16:43:51 +01:00
Patric Stout 85a49a0d36 Change: always allow to click on the toolbar icons for road/rail/dock/airport
This change allows a user to see what is available and what will become
available before it is available, instead of only disabling the button
with no further explanation. It also always allows building roads and
canals, even if no vehicles are available for road / water.

For rail/road/tram, a dropdown with available types is shown. If
none are available, it reads "None". If the type is not yet available,
it is greyed out.

For dock/airport, this always open the toolbar, but building airports,
docks, and depots buttons are disabled till vehicles are available
for those.

Road is the only exception, with the primary road always being
available. Here too, stations and depots are disabled till vehicles
become available. It does mean you can now always build roads to
for example help towns grow.
2021-01-08 16:43:51 +01:00
Chris Stevens a6aec252b1
Fix #8153: Report incompatible cargo/order when autoreplace fails (#8169) 2021-01-08 16:05:49 +01:00
Patric Stout 9aa39d0af9
Fix #7972: show invalid orders to stations that don't accept your vehicle (#8516)
Before it was shown as a normal order, but the vehicle was skipping
it. This was rather unclear to the user. Now it is red and contains
text with some hints what is going on.

The text is prefixed rather than post-fixed, as we have many
post-fixes already.
2021-01-08 16:04:44 +01:00
Patric Stout fda1fbf61c
Revert c1fddb9, 639cfa4: "Codechange: Check if access __attribute__ is supported before trying to use it." (#8526)
This reverts commit c1fddb9a6a and 639cfa43d2.

access_mode "none" is only supported by GCC11, but introduced
after it branched. So there are GCC11.0s out there that do not
support it. We will have to wait for GCC11.1 to hit before we
can re-add this.
2021-01-08 15:25:44 +01:00
Patric Stout 7463c46a54
Fix: for arctic and tropic, make sure we have at least a few hills (#8513)
Without hills, not all industries can be generated, which means
that with a default configuration you get errors. This is far from
optimal, of course.

This now forces that there is at least some hills, even when you
are using very-flat. This is a stopgap solution, but a proper
solution requires a full rewrite of the terrain generator, which
is not a 2 minute (or even 2 week) job.

To make sure flat is still flat-ish, reduce the default
snow-line-height to 10, making it look a lot better on smaller maps.
This is a compromise between being able to have flat maps and
still having all industries on arctic.
2021-01-08 12:02:38 +01:00
Patric Stout aac8c28d73 Fix #7656: destroying a tunnel/bridge now first removes the tracks for cost calculation
This means that for rail tunnel/bridges, the rail is first sold,
and the tunnel/bridge is destroyed after. This means destroying
tunnels/ bridges now often makes you money, instead of costing.

Similar, with road/tram tracks. Destroying a road+tram
tunnel/bridge now costs the same amount of money as first
removing the tram tracks and than destroying the road
tunnel/bridge. Especially as tram tracks generate money when
removing, this is a noticeable difference.
2021-01-08 12:02:25 +01:00
Patric Stout ebd9f26c15 Fix: replacing a bridge didn't charge for clearing last tile
It only considered the end-tile (or start-tile) for the bridge,
instead of both. This is obvious in the rest of the code which
constantly does "+ 2"; this being the only place that does a "+ 1".
2021-01-08 12:02:25 +01:00
Patric Stout ef6b17baf7 Fix 2fd871e2af5: load correct ending-year for old (pre 0.7) savegames
Despite what it looked like, you could never really change the
ending-year (it was always reset to 2050 on start-up). See commit
683b65ee1 for details. As a side-effect, the variable that was
suppose to store the ending-year was just zero, never containing
a real ending-year.
2021-01-08 11:17:08 +01:00
Patric Stout a1987df96a Fix #8050: never show the highscore when disabled, not even if you start in year zero
Using zero as "never" value can have its drawbacks ;)
2021-01-08 11:17:08 +01:00
Patric Stout d9ec8053d7 Fix #8050: ending-year of 5000000 allows you to get to year 5000001 and beyond
MAX_YEAR is set to 5000000, but having an ending-year set to the
same meant you could bypass this, and play till the uint32 wrapped.

The game can either show highscore or wrap year, not both. When
you would do both, every year you get the highscore dialog.

By changing the maximum value of ending-year to 4999999 we prevent
this issue.
2021-01-08 11:17:08 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
milek7 c1fddb9a6a Codechange: Check if access __attribute__ is supported before trying to use it. 2021-01-08 09:12:37 +00:00
milek7 639cfa43d2 Codechange: Use access __attribute__ to silence warnings in GCC 2021-01-08 00:40:45 +00:00
SamuXarick 79d938b957 Fix 0125892: Warning about unsigned unary minus 2021-01-07 21:42:10 +00:00
Patric Stout 725d793be1
Fix: don't allow cloning vehicles if cloning orders is failing (#8515)
Before this fix, any failing clone order was silently ignored
and you as user would never know till you checked the order list.
Evil.
2021-01-07 19:58:04 +01:00
translators 51e22515a8 Update: Translations from eints
spanish (mexican): 5 changes by absay
korean: 5 changes by telk5093
finnish: 5 changes by hpiirai
latvian: 14 changes by lexuslatvia
spanish: 23 changes by SeveralCircles, 10 changes by Luis45ccs
polish: 5 changes by yazalo
2021-01-07 18:28:27 +00:00
SamuXarick f84a466ca5
Fix #7945: Add cost of clearing the sloped tile when placing a dock (#7947) 2021-01-07 10:35:09 +01:00
Patric Stout c988b4d62b
Fix #8332: aborting group drag&drop could cause crashes with vehicle drag&drop (#8511)
The selected group was not reset when drag&drop was aborted. When
after that vehicle drag&drop was successful, group drag&drop code
was still executed, causing weird behaviour or even crashes.
2021-01-07 10:32:24 +01:00
Kuhnovic a3a7928372
Feature: option to auto remove signals when in the way during rail construction (#8274) 2021-01-07 10:17:05 +01:00
Patric Stout 1b675e7075
Fix #8068: always allow removal of tram track if that generates money (#8509)
Even if you are completely broke, generating money should always
be allowed.
2021-01-07 08:01:46 +01:00
Patric Stout c7609e767f
Fix #7604: prevent houses to wander too far from town center when rebuilding (#8507)
When a multi-tile house is rebuild, it always used the most northern
tile to build the new house. This can very easily lead to houses
wandering off in the north-ish direction (either NW or NE).

To prevent this, pick the tile closest to town center when rebuilding
on a multi-tile house. This still means a house can be build away
from a road, but it is no longer wandering around finding another
town to call home.
2021-01-07 08:01:23 +01:00
Patric Stout 28c13ec90f
Fix #8168: allow relocating of HQ partial over existing HQ (#8510)
Just in case you want to move it SLIGHTLY to the right.
2021-01-06 22:37:57 +01:00
Patric Stout a4e34e824c Change: towns can now bridge 4 rails (up from 3)
Having 4 rails is a pretty common design, and towns now couldn't
bridge out of this common design.
2021-01-06 21:39:34 +01:00
Didac Perez Parera 64eddaeb49 Feature: Make maximum length of town bridges depend on population. 2021-01-06 21:39:34 +01:00
translators c3faec4e9a Update: Translations from eints
polish: 7 changes by yazalo
2021-01-06 18:27:36 +00:00
Patric Stout 62cdadb582 Change: move "give money" from client-list to company window
This is a much better location for this button, as you send
money from one company to another company, not from player
to player.

This is based on work done by JGRPP in:
f820543391
and surrounding commits, which took the work from estys:
https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311

We did modify it to fix several bugs and clean up the code while
here anyway.

The callback was removed, as it meant a modified client could
prevent anyone from seeing money was transfered. The message
is now generated in the command itself, making that impossible.
2021-01-05 21:56:24 +01:00
Patric Stout d6e15d4943 Fix: make the "password" button the same size as the other buttons in Company window
Currently password-lock icon + button was the same size, but this
looks really weird. Now they are in sync, even with other fonts
and languages.
2021-01-05 21:56:24 +01:00
Patric Stout a3f0ee3b63 Codechange: fix alignment of Company GUI
Code acted as if WWT_TEXT starts a scope; it does not.
2021-01-05 21:56:24 +01:00
Patric Stout fc474b02fa Fix: change all Company planes on paint, not only the first that needs changing
Otherwise it can take a few OnPaint() calls before all planes are
set correctly when switching companies.
2021-01-05 21:56:24 +01:00
Patric Stout dff7ee8e1c
Fix #7611: keeps news about accidents around after vehicle is cleaned up (#8497)
When a vehicle is cleaned up, all news that points to the news is
also removed. This was a bit evil, as it would also remove any
news related to crashed, acting like the crash never happened.
This left players a bit in the dark what was going on exactly.
2021-01-05 21:39:23 +01:00
translators 0fd2108f7f Update: Translations from eints
persian: 24 changes by alisaffari97
2021-01-05 18:27:57 +00:00
Patric Stout f2fa2a14d7
Fix: allow input of numbers greater than INT32_MAX for GiveMoney (#8499)
Based on patch by JGR.
2021-01-05 19:00:05 +01:00
Patric Stout bb28ff7226
Codechange: DC_NO_RAIL_OVERLAP is a remnant of the OldAI. (#8496)
The OldAI was removed in 2009. Pretty sure we can remove this flag
now too.
2021-01-05 12:36:57 +01:00
gooball c017a3662a
Change: converting town-owned road types now require town rating (#8457) 2021-01-05 11:45:07 +01:00
Charles Pigott e21302f481 Fix #8437: Crash when using certain heliports with rotated airports 2021-01-05 11:42:51 +01:00
Charles Pigott 619d714923 Fix #8437: Planes landing at non-rectangular airports could be drawn at the wrong height
Only the rotated intercontinental airport, don't get excited
2021-01-05 11:42:51 +01:00
Matt Kimber 5728f9c7d0 Codechange: consider vehicle co-ordinates when identifying viewport candidate as using only the hash generates false positives 2021-01-05 11:42:25 +01:00
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 2021-01-05 11:42:25 +01:00