Commit Graph

556 Commits (fe2bcd2a583fd02416ca394062f8f53bacf0722d)

Author SHA1 Message Date
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Rubidium 3373128233 Codechange: pass the randomizer directly to the town name generation 1 year ago
PeterN c8cc61d889
Fix #10150: Force FS_SMALL for small viewport signs. (#10283)
* Fix #10150: Force FS_SMALL for small viewport signs.

This is a workaround for string widths being different with mixed
font-sizes.

* Fix: Flag small sign shadow as small text.

(This method of drawing shadows is hilarious and needs replacing, but
this is a quick fix.)
1 year ago
Joel-Milligan 59645c6733
Change: Remove scrollbar from town authority actions panel (#9928) 2 years ago
Tyler Trahan 47a998fb0c Feature: Towns don't build parallel, redundant bridges 2 years ago
Tyler Trahan fa562ba041
Fix #9712: Cap town bridge length at original 11-tile limit (#9890) 2 years ago
Tyler Trahan f92cf38ab5 Feature: Allow disabling local authority control of company actions 2 years ago
J0anJosep d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 2 years ago
Joan Josep e890e7db76
Cleanup #9725: Clean up Doxygen docs and fix typo. (#9753) 2 years ago
Michael Lutz c521b965bd Codechange: Don't use a global for the terrforming error tile. 2 years ago
Michael Lutz 2e39637db2 Codechange: Don't use a global for the 'not enough cash' message. 2 years ago
Michael Lutz 57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 2 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 2 years ago
Michael Lutz 1a42a8a5d5 Codechange: Un-bitstuff town-related commands. 2 years ago
Michael Lutz 46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 2 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.
2 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2 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.
2 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2 years ago
Patric Stout 2c05412d72
Fix #9407: desync when founding a town nearby a station (#9526)
"stations_near" wasn't updated when founding a town near
a station. As this variable is not saved, any client joining
after the town is founded has a different value for
"stations_near", potentially causing desyncs.

As the intention of this if() statement was to skip an expensive
calculation when there are clearly no stations, better to move
that check inside the function, so other places also enjoy
the speedup.
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 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
3 years ago
rubidium42 4613ababd3 Fix #9316, 64eddaeb: at about 250.000 inhabitants the bridge length limit check overflows 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
rubidium42 661728558e Codechange: let IsUnique.* functions accept std::string 3 years ago
rubidium42 b791ffc6de Fix: do not hide parameter by local variable with the same name 3 years ago
Rubidium 296194ad36 Fix: memory leak due to assigning result of strdup to a std::string 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
Charles Pigott dd798d688b
Fix #8919: Release builds with asserts enabled (#8925) 3 years ago
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 3 years ago
frosch 4ce941bbc2 Codechange: turn a constant variable into a real constant. 3 years ago
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
3 years ago
Tyler Trahan 1dda7d6486
Fix: don't walk out of the map when trying to build tunnels (#8600) 3 years ago
SamuXarick 8da5cff210
Fix #8462: Don't check whether to grow a town road on water (#8471) 3 years ago
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.
3 years ago
Tyler Trahan b0456669c9
Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535) 3 years ago
Tyler Trahan b08c66a796
Fix 7bdfb38: Drive-thru road stations can be connected at either end (#8528) 3 years ago
Tyler Trahan 9c0da686da
Add: Towns can build tunnels (#8473) 3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 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.
3 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.
3 years ago
Didac Perez Parera 64eddaeb49 Feature: Make maximum length of town bridges depend on population. 3 years ago
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 3 years ago
Tyler Trahan 7bdfb382a8
Change: Towns don't build dead-end road bridges (#8401) 3 years ago
dP 7045186594 Change #8159: Remove now unused town cargo caches without bumping the savegame version 4 years ago
Yexo a82572d0f5 Codechange: remove has_newhouses global 4 years ago
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 4 years ago