Commit Graph

24603 Commits (aac8c28d7369a4394303449ce5307067379067bd)
 

Author SHA1 Message Date
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.
3 years ago
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".
3 years ago
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.
3 years ago
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 ;)
3 years ago
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.
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
milek7 c1fddb9a6a Codechange: Check if access __attribute__ is supported before trying to use it. 3 years ago
milek7 639cfa43d2 Codechange: Use access __attribute__ to silence warnings in GCC 4 years ago
SamuXarick 79d938b957 Fix 0125892: Warning about unsigned unary minus 4 years ago
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.
4 years ago
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
4 years ago
SamuXarick f84a466ca5
Fix #7945: Add cost of clearing the sloped tile when placing a dock (#7947) 4 years ago
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.
4 years ago
Kuhnovic a3a7928372
Feature: option to auto remove signals when in the way during rail construction (#8274) 4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
Didac Perez Parera 64eddaeb49 Feature: Make maximum length of town bridges depend on population. 4 years ago
translators c3faec4e9a Update: Translations from eints
polish: 7 changes by yazalo
4 years ago
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.
4 years ago
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.
4 years ago
Patric Stout a3f0ee3b63 Codechange: fix alignment of Company GUI
Code acted as if WWT_TEXT starts a scope; it does not.
4 years ago
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.
4 years ago
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.
4 years ago
translators 0fd2108f7f Update: Translations from eints
persian: 24 changes by alisaffari97
4 years ago
Patric Stout f2fa2a14d7
Fix: allow input of numbers greater than INT32_MAX for GiveMoney (#8499)
Based on patch by JGR.
4 years ago
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.
4 years ago
gooball c017a3662a
Change: converting town-owned road types now require town rating (#8457) 4 years ago
Charles Pigott e21302f481 Fix #8437: Crash when using certain heliports with rotated airports 4 years ago
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
4 years ago
Matt Kimber 5728f9c7d0 Codechange: consider vehicle co-ordinates when identifying viewport candidate as using only the hash generates false positives 4 years ago
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 4 years ago
Matt Kimber eeb88e87d8 Codechange: improve performance for complex vehicle chains by resolving sprites less often 4 years ago
Michael Lutz 979b4af6ca Revert 4ce53cb8: [OSX] Delayed fullscreen switch is not needed anymore.
The fix for #8067 solves the real issue, making this workaround unneeded.
4 years ago
Michael Lutz 6e8be3b03e Fix #8067: [OSX] Calculate title bar height instead of assuming a fixed value. 4 years ago
Andy 0f91cb0479
Fix: GetCurveSpeedLimit needs railtype from current tile (#8466) 4 years ago
Michael Lutz 4ce53cb851 Fix: [OSX] Quitting in fullscreen mode would loose the original window size.
This replicates the behaviour on e.g. Windows, which saves the original window size.
4 years ago
Michael Lutz c860a247d3 Change: [OSX] Hide Dock and menu during fullscreen mode. 4 years ago
translators 784a4ef9b5 Update: Translations from eints
spanish (mexican): 14 changes by absay
finnish: 32 changes by hpiirai
polish: 2 changes by yazalo
4 years ago
frosch b08d8c7edb Cleanup 9f42358: Make also reliability_start randomised independent of introduction date. 4 years ago
frosch d24a9a9df5 Cleanup 8139b14: Move a comment back to the line it belongs to, and add a comment for new code. 4 years ago
Michael Lutz 21a45168bd Codechange: [OSX] CMake source group for OSX files.
This separates the OSX specific files into a proper folder when generating
Xcode project files.
4 years ago
Michael Lutz 6ad5489d01 Codechange: [OSX] Silence some annoying warnings. 4 years ago
Michael Lutz 7bdaabf5f1 Cleanup: [OSX] Remove cargo cult back-buffer alpha setting on show/hide and instead simply initialise the buffer on allocation. 4 years ago
Michael Lutz a61a741683 Change: [OSX] Compiling the Cocoa/Quartz video driver cannot be disabled anymore. 4 years ago
Michael Lutz 9ccef816f9 Codechange: [OSX] Re-arrange the OSX video driver code by combining all drawing code and moving the window/event handling to a different file.
This is just a code move/rename, not a functionality change.
4 years ago
Patric Stout ab7da117e0
Add: always set PERSONAL_DIR "/content_download" in search path (#8481)
This means that if you start OpenTTD with "-c" to indicate another
location to store files, it can still read the content you already
downloaded from your PERSONAL_DIR. This folder is, however,
read-only.

This is useful for situations where you downloaded OpenGFX via
the content-service, but want to run the regression or want to
run with a clean configuration. With this change, you no longer
need to download OpenGFX again.
4 years ago
Michael Lutz 8c24b2b6ce Fix: [OSX] Fonts loaded directly from a file have to be registered with CoreText for proper text layout. 4 years ago
Patric Stout 4bd3d18f34 Add: use our search-paths to find fonts based on relative filenames too
This allows "small_font = ./myfont.ttf", with "myfont.ttf" located
in "~/.openttd".
4 years ago