Commit Graph

365 Commits

Author SHA1 Message Date
Michael Lutz 46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
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.
2021-12-16 22:28:32 +01:00
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
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.
2021-06-03 17:30:00 +02:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
glx22 2feb801e56 Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops 2021-05-03 19:46:57 +02:00
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02: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
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
J0anJosep edbb5f4f73 Doc: Remove some SmallVector references from documentation. 2020-12-27 18:40:18 +00:00
Michael Lutz 79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 2020-12-15 00:29:30 +01:00
ilayaraja97 cf8ccf4b08 Fix #8131: small bridges also have pillars drawn 2020-06-28 13:54:04 +01:00
Niels Martin Hansen 45838d0105 Fix #7958: Use NewGRF provided catenary sprites when either front or back is overridden 2020-02-10 00:17:50 +01:00
Niels Martin Hansen 9e4eee1b9e Codechange: Refactor road bridge catenary drawing 2020-02-10 00:17:50 +01:00
Charles Pigott ab9042145e Fix #6667: Also recalculate bridge costs for 'spectated' AI companies 2020-01-05 20:51:45 +00:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
peter1138 f538179878 Feature: Multi-tile docks and docking points. 2019-06-30 16:46:32 +02:00
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Niels Martin Hansen b8b6954fb5 Fix 6a3d411: Silence truncation warning 2019-01-05 17:21:29 +01:00
Charles Pigott 1778b2d66e Codechange: Merge some duplicated functions 2018-10-31 12:41:49 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Peter Nelson bf8d7df736 Change: Extend rail types to 64 (6 bit storage) 2018-07-26 13:27:40 +01:00
Jonathan G Rennison 6a3d411fa1 Fix: Use after free in CmdBuildTunnel (#6856)
Use after free could occur when when excavating far end
removed multiple NewGRF objects
2018-07-22 21:58:05 +02:00
frosch 10293c5fb1 (svn r27686) -Change: List railtype of rail tiles explicitly in the tile info window. 2016-12-09 21:27:22 +00:00
frosch d9bfe88261 (svn r27676) -Codechange: Rename catenary functions, so that they refer unambiguously to either RoadCatenary or RailCatenary. 2016-11-05 11:53:03 +00:00
frosch 55e53780cb (svn r27313) -Fix [FS#6317]: Adding tram to town-owned bridges assigned an incorrect owner to the tram and did not count infrastructure counts properly. (marcole) 2015-06-21 09:52:30 +00:00
frosch beb213f9ee (svn r27209) -Add: Draw path reservation on the whole bridge, not only on the bridge heads. 2015-03-28 14:04:06 +00:00
frosch 8f03a02efc (svn r27208) -Fix: Draw correct overlay sprites for path reservations on bridges and tunnels. 2015-03-28 14:03:26 +00:00
frosch e8e49e5dda (svn r27157) -Fix: Mark bridge middle tiles dirty when building/removing/changing bridges. 2015-02-22 14:01:24 +00:00
rubidium ce04c49e3d (svn r26882) -Feature: allow limiting the height of bridges (ic111) 2014-09-21 11:40:11 +00:00
rubidium 9daf7e749c (svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible 2014-09-21 11:24:51 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch f0e7f9982a (svn r26277) -Add [FS#5849]: Display speed limit also for road bridges in the TileInfo window. 2014-01-26 13:50:10 +00:00
rubidium b53da6a6f5 (svn r26111) -Fix: theoretical case where sprite table could be overread for aqueducts that start at flat land 2013-11-25 16:26:50 +00:00
rubidium be6b64f4e6 (svn r26072) -Cleanup: mark some unreachable default cases by NOT_REACHED() 2013-11-23 18:13:30 +00:00
frosch 1e41b38b7d (svn r25231) -Fix (r25227): Also update infrastructure counts. (adf88) 2013-05-07 13:49:18 +00:00
frosch d3b9a55535 (svn r25227) -Fix [FS#5541]: Give bridges owned by noone (from bankrupt companies) to the first company which replaces the bridge. Everyone could have removed/rebuild the bridge anyway. 2013-05-06 15:41:34 +00:00
frosch 1e9049e0bd (svn r25141) -Fix: When extra dynamite was disabled, towns would be allowed to clear bridges with trams. 2013-04-03 20:25:06 +00:00
frosch eda4cfeabe (svn r24912) -Fix [FS#5389]: Upgrading bridges could steal road types. (adf88) 2013-01-13 13:17:12 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
planetmaker 812346cad9 (svn r24895) -Fix [FS#5436]: Allow downgrade of road bridges in the scenario editor 2013-01-08 17:56:43 +00:00
frosch 25203976f0 (svn r24413) -Add [FS#5221-ish]: Allow overbuilding bridges with the same type when adding a roadtype. 2012-07-18 19:24:13 +00:00
rubidium 41e5c839e0 (svn r24179) -Codechange: move some variables of Town to TownCache 2012-04-25 20:50:13 +00:00