Commit Graph

67 Commits

Author SHA1 Message Date
Aaron van Geffen 17af7db195 Force sprite update after invoking Staff::SetCostume 2024-04-21 22:54:10 +02:00
Harry Hopkinson 530a7de98f
Replace notation in Guest.h 2024-04-15 16:48:41 +02:00
Claudio Tiecher a94e6c54d8
Part of #21421: replace define with constexpr (#21679) 2024-04-01 07:00:32 -03:00
ζeh Matt ecc46799d4
Replace the old logging code with constexpr functionality 2024-02-22 22:53:42 +02:00
Matt 9d9f0af0cd
Pathfinding cleanup (#21407)
* Eliminate unnecessary abstraction for path finding

* Pass the goal to ChooseDirection instead of using globals

* Remove gPeepPathFindGoalPosition and pass it by parameter instead

* Remove _peepPathFindIsStaff and make ignoring banners explicit

* Code style and naming fixups

* Apply clang-format

* Add comment specifying to why it does not ignore banners

* Apply review comments
2024-02-22 21:52:01 +02:00
Peter Froud 40a7fa70fc
Fix empty error messages (#21351)
* Add `STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE`

* Add `STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER`

* Return existing `GameAction::Result`

* Add `STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE`

I am open to suggestions for a different message!
Originally this was going to be STR_ERR_WRONG_STAFF_TYPE
but I thought that was confusing because the game
action arguments do not specify a staff type. We
want it to mean "the staff ID you specified is the
wrong StaffType for this game action".

* Refactor `StaffSetColour()` to return `Result`

* Remove unnecessary arguments when `Status` is `Ok`

* Refactor `SwapTileElements()` to return `Result`

Also add STR_ERR_CANT_SWAP_TILE_ELEMENT_WITH_ITSELF

* Format code

* Use `STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE` in title

* Format code using Github web editor

* Format indentation
2024-02-19 20:58:04 -03:00
Michael Steenbeek 8dd5014bc4
Move gStaff* globals to GameState_t (#21285) 2024-01-28 07:58:02 -03:00
ζeh Matt a5dde0f8dc
Replace gCurrentTicks with the one in GameState_t 2024-01-19 16:32:19 +02:00
James103 1d8dc111f1
Replace 2023 with 2024 in copyright headers (#21139)
Replace all instances of the year 2023 with 2024 in all copyright headers
2024-01-01 12:52:28 +01:00
Aaron van Geffen d425e0a8bb Remove const qualifier from constexpr statements 2023-06-24 11:45:26 +02:00
Tiago A. Reul 93c1a9724e
Remove flag RIDE_TYPE_FLAG_HAS_NO_TRACK (#20239) (#20249)
* Remove flag RIDE_TYPE_FLAG_HAS_NO_TRACK (#20239)

* Fix a couple of logical conditions in entity/Staff.cpp

* Bump NETWORK_STREAM_VERSION and add myself to contributors.md
2023-05-26 14:08:28 +03:00
Michael Steenbeek 58baa85a27
Small path additions cleanup (#20076)
* Split off path addition paint calls

* Replace occurences of “path bit” with “path addition”

* Replace occurences of “footpath item“ with “path addition”
2023-05-09 20:08:25 +01:00
ζeh Matt 8f82aa95b3
Move Direction out and rename it to Orientation to avoid name conflict 2023-04-07 22:46:25 +03:00
ζeh Matt 679f5aac2e
Rename members of EntitySpriteData 2023-04-07 19:47:26 +03:00
ζeh Matt dce21bc8ec
Split move sprite specific data into EntitySpriteData 2023-04-07 19:37:47 +03:00
Rik Smeets de06f6026e
Fix #18895: Responding mechanic blocked at level crossing (#19620)
Remove the condition regarding the ride's breakdown reason. Other breakdown reasons can also cause trains getting stuck at a level crossing.
2023-04-02 17:57:59 +02:00
Michael Steenbeek fd80b4c822
Refactor and clean up date handling (#19666)
* Refactor and clean up date handling

* Remove gDate, remove direct access to days_in_month

* Adjust the MultiLaunch test

* Bump network version

---------

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2023-04-02 09:25:41 +01:00
Michael Steenbeek dd624f9bff
Replace remaining usages of money16, money32 (#19469)
* Use money64 for ride prices and shop items

* Use money64 for park entrance fee

* Use money64 for gGuestInitialCash

* Use money64 for upkeep costs

* Use money64 for ride value

* Use money64 for marketing campaign cost

* Use money64 for object prices

* Use money64 for land prices

* Use money64 for guest expenditure

* Replace remaining occurrences of money32 with money64

* Update replays

* Bump network version

---------

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2023-03-02 21:55:42 +00:00
Duncan b56748bc82
ObjectEntry Cleanup. FootpathItem, SceneryGroup, Water, LargeScenery (#19385)
* Move footpathitem entry into new getter

* Move scenery group entry into new getter

* Move water entry into new getter

* Move large scenery entry into new getter

* Remove unused header includes

* Fix compile issue

* Include missing header from vcxproj
2023-02-15 21:35:16 +00:00
spacek531 df0edc92d0
Vehicle/rename update flags (#19363)
* rename VEHICLE_UPDATE_FLAG_ON_LIFT_HILL

* rename VEHICLE_UPDATE_FLAG_COLLISION_DISABLED

* rename VEHICLE_UPDATE_FLAG_WAIT_ON_ADJACENT

* rename VEHICLE_UPDATE_FLAG_REVERSING_SHUTTLE

* rename VEHICLE_UPDATE_FLAG_READY_DEPART

* rename VEHICLE_UPDATE_FLAG_TESTING

* rename VEHICLE_UPDATE_FLAG_6

* rename VEHICLE_UPDATE_FLAG_ZERO_VELOCITY

* rename VEHICLE_UPDATE_FLAG_BROKEN_CAR

* rename VEHICLE_UPDATE_FLAG_BROKEN_TRAIN

* rename VEHICLE_UPDATE_FLAG_ON_BRAKE_FOR_DROP

* rename VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES

* rename VEHICLE_UPDATE_FLAG_12

* rename VEHICLE_UPDATE_FLAG_ROTATION_OFF_WILD_MOUSE

* rename VEHICLE_UPDATE_FLAG_SINGLE_CAR_POSITION

* rename VEHICLE_UPDATE_FLAG_CRASHED

* name flag 12 to Reverse Incline Completed Lap

* name flag 6 to Currently Colliding

* fix formatting

* rename has/clear/set update flag

* fix formatting again

* move to namespace constexpr

* fix formatting

* the one that got away
2023-02-12 22:32:16 +00:00
Duncan d811c9a9ba
Add Object Entry Manager (#19332)
* Add object entry manager

Port over wall and banner

* Port over small scenery to ObjectEntryManager

Clang format files

Actually make things safe

Fix build
2023-02-12 20:43:11 +00:00
Matthias Moninger 5994fe6be6
Merge pull request #19284 from ZehMatt/entityId
Refactor sprite_index to entityId for entities
2023-01-28 18:13:04 +02:00
Duncan 24581e781f
Move misc ObjectEntries into Object folder (#19281)
* Move water entry

* Move FootpathEntry

* Move EntranceEntry

* Move SceneryGroupEntry
2023-01-27 19:44:58 +00:00
ζeh Matt 2f8e208a9d
Refactor sprite_index to Id 2023-01-27 19:21:57 +02:00
Duncan ef27814ca5
Split off scenery entries (#19133)
BannerSceneryEntry, WallSceneryEntry footpathItemEntry
2023-01-25 19:56:29 +00:00
Duncan d51b4d3191
Split off SmallSceneryEntry into dedicated file (#19115)
* Split off small scenery entry to new file

* Move flags to new file
2023-01-25 19:25:33 +00:00
Duncan 7d08372c80
Remove snake_case from Class names OpenRCT2/Ride*-S* (#19232)
* Remove snake_case from Class names OpenRCT2/Ride*-S*

* Clang format
2023-01-20 20:58:55 +00:00
Michael Steenbeek 448c8fafd0
Rename base_height, clearance_height and owner 2023-01-19 20:36:30 +01:00
Hielke Morsink 0762fcb601
Rename snake_case functions in OpenRCT2/util folder 2023-01-18 22:44:13 +01:00
Hielke Morsink 917c091e6b
Rename snake_case functions in OpenRCT2/marketing folder 2023-01-17 23:13:39 +00:00
Duncan 09611cd9a5
Remove snake_case from OpenRCT2/entity folder 2023-01-17 21:16:36 +00:00
Michael Steenbeek d6f58c2f1f
Merge pull request #19194 from Gymnasiast/refactor/sub-loc
Rename sub_ and loc_ functions
2023-01-17 21:29:04 +01:00
Michael Steenbeek bb55c6ce66
Remove loadsasnakes (#19192)
* Rename snake_case methods in scenario folder

* Rename snake_case methods in title folder

* Rename snake_case methods in object folder

* Rename snake_case methods in platform folder

* Rename snake_case methods in windows folder

* Rename tile_inspector.h to TileInspectorGlobals.h

* Rename snake_case methods in ui/windows folder
2023-01-17 19:46:55 +00:00
Gymnasiast 3cc2d94b1b
Rename sub_ and loc_ functions 2023-01-17 19:05:14 +01:00
Hielke Morsink 6b7dc8fcdb
Rename snake_case functions in openrct2/src folder
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2023-01-17 13:24:51 +01:00
Stephan Spengler 76b918e7ed
Change openrct2/ride methods to UpperCamelCase, part 1 2023-01-17 01:32:54 +01:00
Michael Steenbeek 412bf8f8be
Use ride references instead of pointers 2023-01-07 14:02:18 +01:00
James103 73738bbdc8
Replace 2022 with 2023 in copyright headers
Replace all instances of the year 2022 with 2023 in all copyright headers
2023-01-01 11:58:01 +01:00
Rik Smeets bd165199cd
Fix #18802: Game can crash on mechanic path finding 2022-12-13 21:46:53 +01:00
Duncan 406b73d904
Remove final snakes from map and world (#18304) 2022-10-12 09:14:45 -03:00
Duncan 7dd8989e70
Next chunk of World/Map.h snakes (#18296)
* Next chunk of World/Map.h snakes

* Apply clang-format
2022-10-12 06:35:20 +01:00
Duncan 67bbc8560d
Code style: Remove snakes from everything world apart from Map.h (#18273)
* Remove remaining snakes from world (outside of map)

* Initial few desnaking of Map.h
2022-10-11 19:39:24 +01:00
Rik Smeets 7c2ec714f7 Improve method name for level crossing check 2022-10-09 11:01:10 +02:00
Duncan 5dba30778d
Code style: Remove more snakes from the park, maphelper, scenery. (#18222) 2022-10-08 06:56:17 -03:00
duncanspumpkin 2a593b6029 Remove snake cases from Location and LargeScenery 2022-10-05 20:21:56 +01:00
duncanspumpkin 3e8dc1b2ac Remove snakes from the foopaths 2022-10-04 20:08:14 +01:00
73 b9e677945d
Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00
Rik Smeets efa7a23773
Fix #18140 & #18143: Invalid read in Staff
The tile element should be determined the same way as is done when checking if the footpath is blocked by a vehicle.

Also added some extra safety checks and made the code a bit more efficient / reusable. For example: when the staff member is not a mechanic, the tile element doesn't have to determined.
2022-09-30 18:00:59 +00:00
Rik Smeets 6c6ea169f1
Add railway crossing behaviour for staff (#18057) 2022-09-24 07:44:19 +02:00
Gymnasiast d3fd31c611
Rename rct_string_id to StringId 2022-07-31 22:30:13 +02:00