Commit Graph

25657 Commits

Author SHA1 Message Date
Paweł Świątkowski
56a46f5cae Fix: Correct name of Golub-Dobrzyn 2021-05-13 10:05:07 +02:00
Paweł Świątkowski
6ee8690b47 Fix: Replace Susz with Leszno
Susz is masculine, not neuter, so it should result in "Susz Mazowiecki",
"Susz Morski", and not "Susz Mazowieckie" or "Susz Morskie". However,
because order of the names whould not be changed, it was replaced with
Leszno, which is neuter.
2021-05-13 10:05:07 +02:00
Rubidium
187a3f20bf Codechange: remove pointless close call due to resolving virtual functions statically in destructors
In the destructors of many of the network related classes Close() is called, just like the
top class in that hierarchy. However, due to virtual functions getting resolved statically
in the destructor it would always call the empty Close() of the top class.
Document the other cases where a virtual call is resolved statically.
2021-05-13 10:03:26 +02:00
Rubidium
7755f81bb8 Codechange: make explicit that virtual functions in a con/destructor are resolved statically
This as during construction the sub class has not been initialized yet, and
during destruction the sub class has already been destroyed, so the overriding
virtual function would be accessing uninitialized data.
2021-05-13 10:03:26 +02:00
Patric Stout
d7ce61f106
Fix #9255: [Network] TCPConnecter crashes when hostname not found (#9259) 2021-05-13 08:13:48 +02:00
glx22
38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 2021-05-13 00:13:54 +02:00
frosch
5bd8144853
Fix #9256, 12e43c697d: invalid read after free. (#9258)
This also changes ScriptEventVehicleAutoReplaced when replacing wagons:
The event is now only spawned, if the head engine changes, so only if the VehicleID of the consist changes.
Previously replacing wagons spawned an event with OldVehicleID==NewVehicleID.
2021-05-12 23:40:03 +02:00
frosch
f6d5c0136e Codechange: make Window destruction not rely on undefined behavior. 2021-05-12 23:22:41 +02:00
frosch
f96f113951 Codechange: use IterateFromBack/Front only if the order is important.
Use Iterate if the order does not matter.
2021-05-12 23:22:41 +02:00
frosch
22567a1f43 Codechange: use iterators instead of 'subranges' when iterating from a specific window.
Using iterators makes it easier to include or exclude the start window in the iteration.
2021-05-12 23:22:41 +02:00
frosch
aba239479b Codechange: remove excessive templating in favour of a single const_cast.
The const_cast will be removed again in a later commit.
2021-05-12 23:22:41 +02:00
frosch
95abdfdef9 Cleanup: remove unneeded labels and gotos.
The window list supports deletion of arbitrary windows, while iterating over it.
2021-05-12 23:22:41 +02:00
PeterN
ba193f2e23
Fix #9186: Fix incorrect bounding box height causing station sprite glitch. (#9187)
Increased height of small station building bounding box to cover the build rather than just the platform.
2021-05-12 21:35:48 +01:00
translators
3e7e2d9ca3 Update: Translations from eints
romanian: 38 changes by kneekoo
slovak: 19 changes by FuryPapaya
catalan: 1 change by J0anJosep
turkish: 191 changes by Anceph
2021-05-12 19:08:38 +00:00
PeterN
b972ed8604
Fix #9242: Tree tick handler did not scale by map size. (#9246)
This means that random tree generation density is higher on small maps and lower on large maps. This difference is enough to make the Lumber Mill impractical to use on large maps.

This change skips ticks on maps smaller than 256x256 and increases iterations or shortens the interval on maps larger than 256x256.
2021-05-12 18:17:57 +01:00
PeterN
7b7dbbc935
Fix #9063: Caption of news window incorrectly aligned. (#9252) 2021-05-12 17:43:35 +01:00
Patric Stout
b136e65cf9
Change: reworked the debug levels for network facility (#9251)
It now follows very simple rules:
0 - Fatal, user should know about this
1 - Error, but we are recovering
2 - Warning, wrong but okay if you don't know
3 - Info, information you might care about
4 -
5 - Debug #1 - High level debug messages
6 - Debug #2 - Low level debug messages
7 - Trace information
2021-05-12 16:34:02 +02:00
Patric Stout
56050fc96f
Fix 91b8ce07: dedicated servers could no longer create screenshots (#9232)
Although most commands are not useful on a dedicated server,
screenshot commands should be dequeued.
2021-05-12 16:31:31 +02:00
PeterN
3d9436bd75
Fix #9202: Invalid test for unset NewGRF override mapping. (#9226) 2021-05-12 09:11:14 +02:00
Loïc Guilloux
c0a0d85d20
Fix: [Actions] Annotations not shown for MSVC (#9247) 2021-05-11 21:43:43 +02:00
translators
1dfc148613 Update: Translations from eints
korean: 1 change by telk5093
slovak: 149 changes by ApplePie420
2021-05-11 19:03:10 +00:00
Patric Stout
d0eb3e4bc4
Fix: [Network] mark server as offline when no longer reachable (#9244) 2021-05-11 19:19:37 +02:00
rubidium42
0968d009c8 Fix #9243: [Network] For a dedicated server use a fallback client and server name
Also warn when the client or server name has not been set and provide pointers on how to set them
2021-05-11 19:09:04 +02:00
Patric Stout
9e7e87ce3e
Fix: [Network] don't rebuild the host-list during iterating the list (#9240)
Additionally, only rebuild it when we added a new manual server,
as otherwise it is a noop anyway.
2021-05-11 12:32:27 +02:00
Patric Stout
9841ebb0bd
Fix: [Network] don't mark the last-joined server as manual (#9239) 2021-05-11 12:26:30 +02:00
Patric Stout
36e22f3a7b
Fix: [Network] clients leaving because of broken connections was not broadcasted (#9238)
The code mixed up "client has quit but we already told everyone"
with "client lost connection, handle this".

Split up those two signals:
- CLIENT_QUIT means we told everyone and the connection is now dead
- CONNECTION_LIST means we should tell everyone we lost a client
2021-05-11 12:26:16 +02:00
translators
2e429ee485 Update: Translations from eints
german: 2 changes by Wuzzy2
2021-05-10 19:04:28 +00:00
Rubidium
495d73a67f Fix: leaking file descriptors 2021-05-10 16:03:31 +02:00
Rubidium
296194ad36 Fix: memory leak due to assigning result of strdup to a std::string 2021-05-10 16:03:31 +02:00
Rubidium
79fc094c54 Cleanup: [Fluidsynth] Remove fluid_player_join
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.
2021-05-10 16:03:16 +02:00
Loïc Guilloux
c53d9991ee
Add: [Actions] Check CI annotations to detect compile warnings (#9217) 2021-05-10 14:48:04 +02:00
Patric Stout
8f4a612a7c
Change: reworded many of the network errors during connect/listen (#9230)
Also changed some levels to 0, as a failing listen() is something
we should tell the user about. Hiding this information is a bit
evil.
2021-05-10 13:40:28 +02:00
translators
b7dd602dcd Update: Translations from eints
finnish: 1 change by hpiirai
2021-05-09 18:57:07 +00:00
Patric Stout
583011bca0
Fix: lobby window doesn't close if no connection could be established (#9223) 2021-05-09 18:48:21 +02:00
Loïc Guilloux
e162d0a55c
Fix: [MinGW] Reapply 48fd7b27 to fix launch on Windows 7 x64 (#9225) 2021-05-09 18:28:47 +02:00
PeterN
330a305c99
Fix: Apply unscaled padding to Viewport inside WWT_INSET. (#9219)
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.
2021-05-08 21:01:16 +01:00
Patric Stout
b9ab3bd6b3 Fix: only query a manually added server if it isn't there yet
But always mark it as manually, no matter if it was there or not.
2021-05-08 17:26:10 +02:00
Patric Stout
fc91f1d1b2 Fix: don't do a network disconnect between two queries
This meant that on opening the Multiplayer window, if you had more
than one server configured, it would one by one cancel all pending
queries and send a new. Result: only the last server was updated.
2021-05-08 17:26:10 +02:00
Patric Stout
1b75a29d12 Fix: destroying a TCPConnecter that was still resolving made illegal writes
Basically, we should join the resolve thread before we destruct
the object.
2021-05-08 17:26:10 +02:00
Patric Stout
664a8c3e85 Codechange: move connection_string to private for TCPConnecter
The most common case never needs access to it anymore. Make the
one exception to this explicit. This means the fact that we
store it is now an implementation detail.
2021-05-08 17:26:10 +02:00
rubidium42
de940b1dbc Fix fdc11a9: Missing sprite count determined on the wrong file 2021-05-08 14:24:35 +02:00
Rubidium
fa6abe1646 Cleanup: remove the old FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
10e35ca8e4 Codechange: let NewGRF make use of SpriteFile instead of most of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
fdc11a9f94 Codechange: introduce SpriteFile to be used by the sprite loader instead of the global FIO slot functionality 2021-05-08 12:39:34 +02:00
Rubidium
0dd339ecd8 Codechange: lets music make use of RandomAccessFile instead of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
c097bc9d7d Codechange: let NewGRF sounds make use of RandomAccessFile instead of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
b144e56b2c Codechange: use the new RandomAccessFile as backend for the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidium
8e0b1b5d1a Add: concept of a RandomAccessFile to replace the FIO slot functions 2021-05-08 12:39:34 +02:00
PeterN
69e5da0b54
Codechange: Don't save unused NewGRF override mappings. (#9202) 2021-05-08 11:36:39 +01:00
William Davis
881e1da51d
Change: Use gender-neutral pronouns in console command messages (and comments) (#9203) 2021-05-08 11:02:30 +01:00