Commit Graph

132 Commits (03e0ec8276d53605b6b88917909cd7e5b3ec6cbc)

Author SHA1 Message Date
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
6 months ago
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
7 months ago
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.
7 months ago
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
7 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 9 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 10 months ago
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
12 months ago
Jonathan G Rennison f9c9f53882 Fix town 0 not being included in public roads network
See: #530
1 year ago
Peter Nelson 1a93618bd1 Fix: Road type is not available before its introduction date. 1 year ago
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.
1 year ago
Tyler Trahan 98d809c33b
Codechange: Don't use macros for DAYS_TILL and friends (#10746) 1 year ago
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
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
1 year ago
Peter Nelson 65e0b0dcb7 Codechange: Be consistent with how company masks are set to all. 1 year ago
Jonathan G Rennison b07d964081 Allow use of GetTownRoadType result in HasRoadTypeAvail for towns 1 year ago
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
1 year ago
Jonathan G Rennison 983790ec7a Remove unused town argument from GetTownRoadType 1 year ago
Rubidium 8fa61533f0 Fix 30ae072: when a road type is hidden, towns may not build them even when that flag is set 1 year ago
Jonathan G Rennison cbd71b3d58 Merge branch 'master' into jgrpp
# Conflicts:
#	src/order_cmd.cpp
1 year ago
Rubidium 30ae07269d Fix: game scripts must not build with non-existing road types 1 year ago
Jonathan G Rennison 0a8c58b755 Public roads: Fix memory leaks 1 year ago
Jonathan G Rennison db224585eb Revert "Public roads: Dynamically set A* max search nodes"
This reverts commit acd67a0d0b.
1 year ago
Jonathan G Rennison 8e5371eec4 Public roads: Fix handling of non-trivial foundations 1 year ago
Jonathan G Rennison ad90f90d43 Public roads: Adjust return type of town_network_distance 1 year ago
Jonathan G Rennison acd67a0d0b Public roads: Dynamically set A* max search nodes 1 year ago
Jonathan G Rennison ff189e44e4 Public roads: Handle non-trivial existing foundations 1 year ago
Jonathan G Rennison 2d1b3fb6e7 Public roads: Remove visited towns mechanism
It is excessively expensive, and not needed
1 year ago
Jonathan G Rennison 5641c926bf Public roads: Use robin_hood hash maps for checked towns and town to network 1 year ago
Jonathan G Rennison b56d7267dc Public roads: Remove unnecessary sorting operations 1 year ago
Jonathan G Rennison 3967a9fdb0 Public roads: Reuse AyStar finder instance 1 year ago
Jonathan G Rennison 06ffc0ba70 Public roads: Avoid dangling pointer issues in AyStar user target 1 year ago
Jonathan G Rennison f8130f5cb7 Public roads: Remove use of shared_ptr 1 year ago
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
2 years ago
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.
2 years ago
Jonathan G Rennison 57c0ce1270 Fix public roads when traversing level crossings and other non-normal road 2 years ago
Jonathan G Rennison 8b5b96af77 Fix typos in PostProcessNetworks 3 years ago
Andreas Schmitt c475fb12c0 Add sanity check 3 years ago
Andreas Schmitt 7a0150735e Adjust the cost function again for better bridge and tunnel use 3 years ago
Andreas Schmitt d4fd7f62d1 Build a couple of cycles in the network by connecting each town to the three closest ones in its network 3 years ago
Jonathan G Rennison f53ed56200 Increase bridge/tunnel per-tile cost 3 years ago
Jonathan G Rennison 9683676df1 Use GetTileMaxZ for slope cost check to avoid overly penalising foundations 3 years ago
Jonathan G Rennison 5e7b8ccd43 Only calculate input points once in IsBlockedByPreviousBridgeOrTunnel 3 years ago
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
3 years ago
Jonathan G Rennison 724474e435 Use MayTownBuildBridgeType/BSCF_NOT_AVAILABLE_TOWN for bridge type check 3 years ago
Jonathan G Rennison 96bfcd587b Fix signedness mismatch warning in tunnel length check 3 years ago
Andreas Schmitt a3d1b916d1 Limit tunnel length at the proper place 3 years ago
Andreas Schmitt 3e771dc18d Revert bug inducing change 3 years ago
Andreas Schmitt b175203d54 Add comment 3 years ago
Andreas Schmitt a73cb99695 Do not build bridges with additional specs
Prior to this change, additional bridge sets like modular bridges would be used.
Those might not be suitable for public roads. Those bridges should be left to the player.
3 years ago