1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00
Commit Graph

236 Commits

Author SHA1 Message Date
Vinicius Sa
f8dd0a57aa Refactor PeepActionSpriteType to use strong enum 2020-09-29 11:15:04 -03:00
Łukasz Pękalski
d1cd2e08b5 Close #12388, refactor PeepState to use strong enum (#12927)
* Close #12388, refactor:PeepState to use strong enum

* refactor: refactored file PlayTests.cpp

* refactor: change PEEP_STATE_ to PeepState:: and camel case after merging

chore: code reformatting
2020-09-28 15:51:49 -03:00
Richard Fine
a1222fa4ca Staff code cleanup (#12907)
* Make UpdateFixing*() methods use const where possible

To make it clearer which steps actually modify the ride being fixed and which do not, pass const Ride* instead of Ride* where possible.

* Extract maximum litter search distance to a constant

* Make peep_update_*() methods return bool

* Use Direction type and helpers where applicable

* Const correctness and other cleanup

Make many functions take a const Peep* / const Staff* to clarify that they do not modify the peep being passed in. Also use the Direction type for some return values, and simplify staff_is_location_on_patrol_edge.

* Use clearer expression of constant value

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

* Convert staff functions to members

* Remove AsStaff const overload

* Use As<Staff>() instead of static_cast

* Simplify direction selection code

* Clean up use of magic constants

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-09-27 21:07:09 -03:00
Richard Fine
b57ed85098 Fixes from review feedback 2020-09-16 21:24:35 -04:00
Richard Fine
542eb873fc Consolidate pathfinding code
Consolidate all the guest pathfinding code from Peep.cpp into GuestPathfinding.cpp, and make a dedicated header for GuestPathfinding to help make it easier to see what the actual public interface is to the pathfinding system.
2020-09-12 14:59:40 -04:00
Richard Fine
d2d9750a5b Fix #5753: Entertainers make themselves happy instead of the guests
After identifying guests that are near an entertainer, modify the guest's HappinessTarget and TimeInQueue values instead of the entertainer's own values.
2020-09-08 16:40:29 -04:00
Jacob Schwartz
fe71ce437d Close #12434: Refactor ENTERTAINER_COSTUME to use strong enum (#12865) 2020-09-08 16:29:18 -03:00
Simon Ellmann
5f3fe62f83 Close #12432: Refactor STAFF_MODE to use strong enum (#12752)
* Refactor STAFF_MODE to use strong enum

Closes #12432

* Change type of gStaffModes to StaffMode
2020-09-02 12:48:40 -03:00
ryan-bello
cc2bb33892 changed enum STAFF_TYPE to strong enum StaffType, moved it to Peep.h 2020-08-17 22:59:02 -04:00
ryan-bello
54a33cbde8 renamed StaffType to AssignedStaffType 2020-08-17 20:16:09 -04:00
Duncan
c6e26267a4 Reduce the use of GET_VEHICLE (#12494)
* Start removing GET_VEHICLE macro use

* Further work

* Remove further GET_VEHICLE's

* Further removal of GET_VEHICLE

* Remove the last of GET_VEHICLE

* Fix testpaint

* Fix nullptr deref

* Make review changes

Also swapped in helper functions and used a standard patern for iterating the train cars

* Further simplify loops for train cars
2020-07-31 07:48:27 +01:00
Matt
fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Jim
b1600e14ae Close #12177: Extract patrol offset and index calculation into method 2020-07-09 23:47:21 +02:00
Jimver
bda0126539 Part of #12162: Use CoordsXY on staff_is_patrol_area_set 2020-07-09 14:20:37 +02:00
Jimver
e4c4c611eb Part of #12162: Use CoordsXY on staff_set_patrol_area 2020-07-09 14:17:41 +02:00
Jimver
eb753261a1 Part of #12162: Use CoordsXY on staff_toggle_patrol_area 2020-07-09 14:12:32 +02:00
Jim
0248621502 Increase handyman randomness in queue (#12145)
* Increase randomness when handyman is on queue path

* Add myself to contributors

* Refactor hex variable probabilities

* Add check if queue is connected to a ride

* Update changelog

* Bump network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-07-08 19:48:08 +01:00
duncanspumpkin
e51bbeed23 Convert SPRITE_LIST to an enum class 2020-07-04 07:38:11 +01:00
Tulio Leao
abcb50ff96 Make staff_can_ignore_wide_flag use CoordsXYZ 2020-06-23 00:13:01 -03:00
Tulio Leao
caeed92cf0 Make staff_is_location_on_patrol_edge use CoordsXY 2020-06-21 16:41:18 -03:00
Tulio Leao
7622ca513e Make litter_remove_at use CoordsXYZ 2020-06-21 14:06:56 -03:00
Michael Steenbeek
e2b187c24a Merge pull request #11921 from duncanspumpkin/CreateSprite6
Entity List Iterator
2020-06-17 21:28:36 +02:00
duncanspumpkin
6ed17b4ff9 Remove FOR_ALL_PEEPS/GUESTS/STAFF macros
Replaced with an EntityList iterator

Fix formatting

Fix nullptr issues
2020-06-16 20:27:44 +01:00
duncanspumpkin
c45a0536eb Use new class 2020-06-16 20:27:40 +01:00
duncanspumpkin
a30374d200 Use new iterator
Fix mac builds

Fix minor mistake

Fix vehicle loops
2020-06-16 20:25:47 +01:00
duncanspumpkin
904e6c6987 Implement GetSprite and use it in a number of places
This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
2020-06-16 20:21:56 +01:00
Gymnasiast
9cf12e763d Move RideHeights and max mass to RTDs 2020-06-16 20:57:55 +02:00
Gymnasiast
140f2d6922 Rename rct_ride_data_5 and its fields to RideHeights 2020-06-16 20:17:07 +02:00
Tulio Leao
e54a3d89f2 Rename some Peep member variables to use TitleCase (#11931)
* Rename Peep::destination_tolerance to use TitleCase

* Rename Peep::destination_y to use TitleCase

* Rename Peep::destination_x to use TitleCase

* Rename Peep::trousers_colour to use Title Case

* Rename Peep::tshirt_colour to use TitleCase

* Rename Peep::no_of_rides to use Title Case

* Rename Peep::staff_type to use TitleCase

* Rename Peep::type to use TitleCase

* Rename Peep::sprite_type to use TitleCase

* Rename Peep::sub_state to use TitleCase

* Rename Peep::state to use TitleCase

* Rename Peep::outside_of_park to use TitleCase

* Rename Peep::next_flags to use TitleCase

* Rename Peep::name to use TitleCase

* Rename Peep::NoOfRides to GuestNoOfRides

* Rename Peep::Type to AssignedPeepType

* Rename Peep::GuestNoOfRides to GuestNumRides
2020-06-14 06:31:08 +01:00
Tulio Leao
5d57012390 Rename Peep::var_37 to Var37 2020-06-08 23:47:45 -03:00
Tulio Leao
1b7223462f Rename Peep::happiness_target to use TitleCase 2020-06-08 23:27:47 -03:00
Tulio Leao
f732c2f1cd Rename Peep::window_invalidate_flags to use TitleCase 2020-06-08 22:25:54 -03:00
Tulio Leao
ccd76f8fc4 Rename Peep::current_ride to CurrentRide 2020-06-08 17:36:35 -03:00
Tulio Leao
c302b16386 Rename Peep::current_ride_station to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
89a084cbc9 Rename Peep::action_sprite_type to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
d9e36e5592 Rename Peep::action_sprite_image_offset to TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
e98cea3615 Rename Peep::action* to Action* 2020-06-08 17:36:33 -03:00
Michael Steenbeek
a0c6752ff3 Merge pull request #11882 from tupaschoal/prevent-shadow-peep-4
Rename some Peep member variables to use TitleCase
2020-06-07 23:35:23 +02:00
Michael Steenbeek
7646f1b7e4 Merge pull request #11896 from hdpoliveira/update_flags
Update flags
2020-06-07 23:03:48 +02:00
hdpoliveira
5b1469b8b7 Create Vehicle::GetTrackType() (#11895) 2020-06-07 21:43:32 +01:00
hdpoliveira
480d1a6d6b Create Vehicle::ClearUpdateFlag 2020-06-07 17:16:12 -03:00
Tulio Leao
357db49819 Rename Peep::mechanic_time_sine_call to use TitleCase 2020-06-06 11:53:51 -03:00
Tulio Leao
1a3f8490ad Rename Peep::direction to PeepDirection 2020-06-06 11:53:51 -03:00
Tulio Leao
8400a7f54d Rename Peep::time_in_queue to TimeInQueue 2020-06-06 11:53:51 -03:00
Tulio Leao
cf4b052cd4 Rename Peep::time_in_park to TimeInPark 2020-06-06 11:26:04 -03:00
Michael Steenbeek
f21ddb0723 Refactor checks for station pieces (#11876) 2020-06-05 17:55:15 -03:00
Tulio Leao
57a2dab064 Rename Peep::NoActionFrameNum to WalkingFrameNum 2020-06-04 19:16:25 +02:00
Tulio Leao
6dc08afdd0 Rename Peep:staff_id to StaffId 2020-06-04 19:16:24 +02:00
Tulio Leao
9fbaf61e07 Rename Peep::staff_orders to StaffOrders 2020-06-04 19:16:12 +02:00