Commit Graph

137 Commits

Author SHA1 Message Date
Jonathan G Rennison
0e76f774eb Merge branch 'master' into jgrpp
# Conflicts:
#	src/landscape.cpp
#	src/landscape.h
#	src/misc_gui.cpp
#	src/newgrf_commons.cpp
#	src/order_cmd.cpp
#	src/pathfinder/yapf/yapf_base.hpp
#	src/station_cmd.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/water_cmd.cpp
#	src/window.cpp
2024-03-09 21:44:36 +00:00
Michael Lutz
8dda387f82 Codechange: Use std::tuple for slope functions with two return values 2024-03-08 18:08:55 +01:00
Jonathan G Rennison
7ce06e22b8 Split date types into calendar and economy dates
See: 735abfe1
2024-02-13 21:34:09 +00:00
Jonathan G Rennison
97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
2024-01-07 17:20:41 +00:00
Jonathan G Rennison
8751bd2ba7 Add some [[maybe_unused]] tags for when asserts are disabled 2024-01-02 15:11:03 +00:00
Jonathan G Rennison
03e0ec8276 Strong typedef: Use strong typedefs for date, date tick, minutes types
Add delta types
Adjust/add type conversion functions
Add various utility methods on types
Remove the various minute macros
Fix some minute conversion inconsistencies
2023-12-19 02:39:54 +00:00
Jonathan G Rennison
88670a230f Merge branch 'master' into jgrpp
# Conflicts:
#	src/articulated_vehicles.cpp
#	src/articulated_vehicles.h
#	src/base_media_base.h
#	src/base_media_func.h
#	src/build_vehicle_gui.cpp
#	src/dock_gui.cpp
#	src/main_gui.cpp
#	src/music_gui.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content.cpp
#	src/newgrf.cpp
#	src/newgrf_roadstop.cpp
#	src/os/windows/string_uniscribe.h
#	src/os/windows/win32.cpp
#	src/rail_gui.cpp
#	src/road.cpp
#	src/road_gui.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.cpp
#	src/strings.cpp
#	src/terraform_gui.cpp
#	src/tests/test_script_admin.cpp
#	src/tests/test_window_desc.cpp
#	src/timer/timer_game_calendar.h
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/viewport.cpp
#	src/widget_type.h
#	src/window.cpp
#	src/window_gui.h
2023-11-29 20:42:29 +00:00
Peter Nelson
ab535c0a86 Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
2023-11-06 20:29:35 +00:00
Peter Nelson
7d4a91ef9e Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +00:00
Tyler Trahan
77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 2023-09-10 08:40:25 -04:00
Patric Stout
299570b2c1 Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 2023-08-12 18:14:21 +00:00
Jonathan G Rennison
d09b504bc5 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-source.yml
#	.github/workflows/release.yml
#	CMakeLists.txt
#	COMPILING.md
#	src/ai/ai_core.cpp
#	src/ai/ai_gui.cpp
#	src/bridge_gui.cpp
#	src/company_gui.cpp
#	src/console_cmds.cpp
#	src/core/CMakeLists.txt
#	src/core/smallmap_type.hpp
#	src/disaster_vehicle.h
#	src/effectvehicle_base.h
#	src/fontcache.cpp
#	src/game/game_core.cpp
#	src/game/game_gui.cpp
#	src/gamelog.cpp
#	src/gamelog_internal.h
#	src/group_gui.cpp
#	src/linkgraph/linkgraph.h
#	src/misc.cpp
#	src/network/core/config.h
#	src/network/core/udp.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content_gui.cpp
#	src/network/network_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_gui.cpp
#	src/newgrf_profiling.cpp
#	src/newgrf_profiling.h
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/openttd.h
#	src/order_gui.cpp
#	src/os/windows/font_win32.cpp
#	src/rail_gui.cpp
#	src/road.cpp
#	src/road_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/script/api/script_controller.cpp
#	src/script/api/script_roadtypelist.cpp
#	src/script/script_config.cpp
#	src/script/script_config.hpp
#	src/script/script_instance.cpp
#	src/script/script_scanner.cpp
#	src/script/squirrel.cpp
#	src/script/squirrel_helper.hpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/table/settings/network_private_settings.ini
#	src/timetable_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/window_gui.h
2023-07-01 02:42:51 +01:00
Jonathan G Rennison
f9c9f53882 Fix town 0 not being included in public roads network
See: #530
2023-06-04 19:01:19 +01:00
Peter Nelson
1a93618bd1 Fix: Road type is not available before its introduction date. 2023-05-12 21:03:13 +02:00
Peter Nelson
5059e23ed5 Revert 8fa61533: "Fix 30ae072: when a road type is hidden, towns may not build them even when that flag is set"
This reverts commit 8fa61533f0.
2023-05-12 21:03:13 +02:00
Tyler Trahan
98d809c33b Codechange: Don't use macros for DAYS_TILL and friends (#10746) 2023-05-07 05:25:24 -04:00
Tyler Trahan
930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 2023-04-26 07:14:03 -04:00
Patric Stout
7aa2b9ab0a Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
Jonathan G Rennison
82803b98e0 Merge branch 'master' into jgrpp
# Conflicts:
#	src/game/game_gui.cpp
#	src/graph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf.cpp
#	src/order_gui.cpp
#	src/saveload/engine_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_text.cpp
#	src/script/script_gui.cpp
#	src/settings_table.cpp
#	src/strings.cpp
#	src/table/settings/economy_settings.ini
#	src/table/settings/locale_settings.ini
#	src/timetable_gui.cpp
2023-04-10 15:11:53 +01:00
Peter Nelson
65e0b0dcb7 Codechange: Be consistent with how company masks are set to all. 2023-04-07 22:09:55 +01:00
Jonathan G Rennison
b07d964081 Allow use of GetTownRoadType result in HasRoadTypeAvail for towns 2023-03-06 01:07:16 +00:00
Jonathan G Rennison
faa77e2605 Merge branch 'master' into jgrpp
# Conflicts:
#	src/script/api/script_company.cpp
#	src/script/api/script_date.cpp
#	src/script/api/script_date.hpp
#	src/script/api/script_gamesettings.cpp
#	src/script/api/script_order.hpp
#	src/script/api/script_town.cpp
#	src/script/api/script_window.cpp
2023-03-06 01:05:43 +00:00
Jonathan G Rennison
983790ec7a Remove unused town argument from GetTownRoadType 2023-03-05 21:28:24 +00:00
Rubidium
8fa61533f0 Fix 30ae072: when a road type is hidden, towns may not build them even when that flag is set 2023-03-05 22:01:54 +01:00
Jonathan G Rennison
cbd71b3d58 Merge branch 'master' into jgrpp
# Conflicts:
#	src/order_cmd.cpp
2023-03-05 12:41:58 +00:00
Rubidium
30ae07269d Fix: game scripts must not build with non-existing road types 2023-03-05 07:17:38 +01:00
Jonathan G Rennison
0a8c58b755 Public roads: Fix memory leaks 2023-02-28 01:41:08 +00:00
Jonathan G Rennison
db224585eb Revert "Public roads: Dynamically set A* max search nodes"
This reverts commit acd67a0d0b.
2023-02-26 15:45:41 +00:00
Jonathan G Rennison
8e5371eec4 Public roads: Fix handling of non-trivial foundations 2023-02-26 14:45:40 +00:00
Jonathan G Rennison
ad90f90d43 Public roads: Adjust return type of town_network_distance 2023-02-26 13:31:39 +00:00
Jonathan G Rennison
acd67a0d0b Public roads: Dynamically set A* max search nodes 2023-02-26 13:31:39 +00:00
Jonathan G Rennison
ff189e44e4 Public roads: Handle non-trivial existing foundations 2023-02-26 13:31:39 +00:00
Jonathan G Rennison
2d1b3fb6e7 Public roads: Remove visited towns mechanism
It is excessively expensive, and not needed
2023-02-26 13:31:39 +00:00
Jonathan G Rennison
5641c926bf Public roads: Use robin_hood hash maps for checked towns and town to network 2023-02-26 13:31:39 +00:00
Jonathan G Rennison
b56d7267dc Public roads: Remove unnecessary sorting operations 2023-02-25 22:14:22 +00:00
Jonathan G Rennison
3967a9fdb0 Public roads: Reuse AyStar finder instance 2023-02-25 22:14:22 +00:00
Jonathan G Rennison
06ffc0ba70 Public roads: Avoid dangling pointer issues in AyStar user target 2023-02-25 22:14:22 +00:00
Jonathan G Rennison
f8130f5cb7 Public roads: Remove use of shared_ptr 2023-02-25 22:14:22 +00:00
Jonathan G Rennison
71b6d7a502 Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/arabic_egypt.txt
#	src/station_cmd.cpp
#	src/station_cmd.h
#	src/timetable_cmd.cpp
#	src/train_cmd.cpp
2022-07-30 20:38:34 +01:00
Patric Stout
4651ad94fe Fix: commands with a RoadType in their arguments were not validated properly (#9944)
Although it was checked that RoadType was not 63 (INVALID_ROADTYPE),
and all values lower than 63 are fine, it also allowed values higher
than 63. As the RoadType is a "byte", it could contain values up
to 255.
2022-07-09 10:03:57 +02:00
Jonathan G Rennison
57c0ce1270 Fix public roads when traversing level crossings and other non-normal road 2022-05-29 00:18:31 +01:00
Jonathan G Rennison
8b5b96af77 Fix typos in PostProcessNetworks 2021-10-24 13:33:02 +01:00
Andreas Schmitt
c475fb12c0 Add sanity check 2021-06-19 13:11:03 +01:00
Andreas Schmitt
7a0150735e Adjust the cost function again for better bridge and tunnel use 2021-06-19 13:11:03 +01:00
Andreas Schmitt
d4fd7f62d1 Build a couple of cycles in the network by connecting each town to the three closest ones in its network 2021-06-19 13:11:03 +01:00
Jonathan G Rennison
f53ed56200 Increase bridge/tunnel per-tile cost 2021-06-19 13:11:03 +01:00
Jonathan G Rennison
9683676df1 Use GetTileMaxZ for slope cost check to avoid overly penalising foundations 2021-06-19 13:02:36 +01:00
Jonathan G Rennison
5e7b8ccd43 Only calculate input points once in IsBlockedByPreviousBridgeOrTunnel 2021-06-19 13:02:36 +01:00
Jonathan G Rennison
90e75871ad Fix bridge/tunnel building not using DC_AUTO
This could result in existing infrastructure being removed at
the bridge/tunnel far end
2021-06-19 13:02:36 +01:00
Jonathan G Rennison
724474e435 Use MayTownBuildBridgeType/BSCF_NOT_AVAILABLE_TOWN for bridge type check 2021-06-19 13:02:36 +01:00