Commit Graph

1285 Commits

Author SHA1 Message Date
ζeh Matt 219d49aee1
Refactor explicit constructor usage in StaffSetOrdersAction 2021-10-27 04:32:04 +03:00
ζeh Matt 931b7f628d
Refactor explicit constructor usage in StaffSetNameAction 2021-10-27 04:32:04 +03:00
ζeh Matt d006a1f488
Refactor explicit constructor usage in SmallScenerySetColourAction 2021-10-27 04:32:04 +03:00
ζeh Matt 5a237bd663
Refactor explicit constructor usage in StaffSetColourAction 2021-10-27 04:32:04 +03:00
ζeh Matt cce3609c75
Refactor explicit constructor usage in LandRaiseAction 2021-10-27 04:32:04 +03:00
ζeh Matt d1c79e63f5
Refactor explicit constructor usage in StaffFireAction 2021-10-27 04:32:04 +03:00
ζeh Matt 76114bca2f
Refactor explicit constructor usage in SmallSceneryRemoveAction 2021-10-27 04:32:03 +03:00
ζeh Matt d99c6641e7
Refactor explicit constructor usage in LandSetHeightAction 2021-10-27 04:32:03 +03:00
ζeh Matt 1acbf14985
Refactor explicit constructor usage in SignSetStyleAction 2021-10-27 04:32:03 +03:00
ζeh Matt 18eaada85b
Refactor explicit constructor usage in SetParkEntranceFeeAction 2021-10-27 04:32:03 +03:00
ζeh Matt 8f9ad4743d
Refactor explicit constructor usage in FootpathPlaceAction 2021-10-27 04:32:03 +03:00
ζeh Matt 4fe71f3b45
Refactor explicit constructor usage in LargeSceneryPlaceAction 2021-10-27 04:32:03 +03:00
ζeh Matt effc6f4413
Refactor explicit constructor usage in FootpathRemoveAction 2021-10-27 04:32:03 +03:00
ζeh Matt 1660a5080b
Refactor explicit constructor usage in RideSetColourSchemeAction 2021-10-27 04:32:02 +03:00
ζeh Matt bb149d471c
Refactor explicit constructor usage in RideSetAppearanceAction 2021-10-27 04:32:02 +03:00
ζeh Matt 4a408821fd
Refactor explicit constructor usage in RideEntranceExitPlaceAction 2021-10-27 04:32:02 +03:00
ζeh Matt 33b18309cb
Refactor explicit constructor usage in ParkMarketingAction 2021-10-27 04:32:02 +03:00
ζeh Matt 1014c84620
Refactor explicit constructor usage in RideEntranceExitRemoveAction 2021-10-27 04:32:02 +03:00
ζeh Matt 586147c8dc
Refactor explicit constructor usage in FootpathPlaceFromTrackAction 2021-10-27 04:32:02 +03:00
ζeh Matt 6bfefc1cbd
Refactor explicit constructor usage in PeepPickupAction 2021-10-27 04:32:01 +03:00
ζeh Matt 4429bce005
Refactor explicit constructor usage in ParkSetResearchFundingAction 2021-10-27 04:32:01 +03:00
ζeh Matt ea6d2f6b65
Refactor explicit constructor usage in ParkSetParameterAction 2021-10-27 04:32:01 +03:00
ζeh Matt 9f4f1136ed
Refactor explicit constructor usage in ParkSetDateAction 2021-10-27 04:32:01 +03:00
ζeh Matt c4465464b6
Refactor explicit constructor usage in BannerSetColourAction 2021-10-27 04:32:01 +03:00
ζeh Matt 59a752bb15
Refactor explicit constructor usage in LargeScenerySetColourAction 2021-10-27 04:32:01 +03:00
ζeh Matt 16a30c13a3
Refactor explicit constructor usage in BannerRemoveAction 2021-10-27 04:32:00 +03:00
ζeh Matt cd7d5a0b40
Refactor explicit constructor usage in ParkEntranceRemoveAction 2021-10-27 04:32:00 +03:00
ζeh Matt d44bb21d97
Refactor explicit constructor usage in BannerSetStyleAction 2021-10-27 04:32:00 +03:00
ζeh Matt c4ea5732ea
Refactor explicit constructor usage in LargeSceneryRemoveAction 2021-10-27 04:32:00 +03:00
ζeh Matt f207ad4f64
Refactor explicit constructor usage in FootpathAdditionRemoveAction 2021-10-27 04:32:00 +03:00
ζeh Matt 520053a9ff
Refactor explicit constructor usage in LandLowerAction 2021-10-27 04:32:00 +03:00
ζeh Matt a9d9fd5f4f
Refactor explicit constructor usage in FootpathAdditionPlaceAction 2021-10-27 04:31:59 +03:00
ζeh Matt f8d9b0a2f9
Refactor explicit constructor usage in GuestSetNameAction 2021-10-27 04:31:59 +03:00
ζeh Matt fe3d3bdb3f
Refactor explicit constructor usage in GuestSetFlagsAction 2021-10-27 04:31:59 +03:00
ζeh Matt fcce046a48
Refactor explicit constructor usage in BannerPlaceAction 2021-10-27 04:31:59 +03:00
ζeh Matt cad2f42703
Refactor explicit constructor usage in BalloonPressAction 2021-10-27 04:31:59 +03:00
ζeh Matt 43608c807c
Make construction of GameActions::Result explicit 2021-10-27 04:31:59 +03:00
ζeh Matt 31239e3941
Refactor result passing on ConstructClearResult 2021-10-21 19:26:17 +03:00
ζeh Matt 7a30169c28
Refactor out construction clearance into a new compilation unit 2021-10-20 22:21:54 +03:00
ζeh Matt ea0b8840ac
Merge pull request #15610 from ZehMatt/refactor/stringvariant
Replace StringVariant with std::variant
2021-10-20 10:46:42 -07:00
Michael Steenbeek 578d8ce247
Fix #15612: Crash in WallCheckObstruction() 2021-10-20 14:15:35 +00:00
ζeh Matt 5bf3513156
Default initialize ErrorTitle and ErrorMessage with STR_NONE 2021-10-20 16:35:58 +03:00
ζeh Matt 7fc49fca39
Replace StringVariant with std::variant 2021-10-20 16:35:58 +03:00
ζeh Matt 8e06d84a09
Refactor result passing of TrackDesignAction 2021-10-20 16:08:21 +03:00
ζeh Matt e06f9c3ee7
Refactor result passing of TrackPlaceAction 2021-10-20 14:15:24 +02:00
ζeh Matt 2d78a5efc3
Move GameActionResult into its own unit (#15588) 2021-10-19 17:50:24 -03:00
Hielke Morsink 9dd20ec619
Improve array formatting
For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
2021-10-17 18:21:45 +02:00
Michał Janiszewski 1b4875e528 Extract math-related functions from common.h to Math.hpp
Saves wide inclusion of <stdexcept> header, which pulls in <string>
2021-10-09 21:43:06 +02:00
Michał Janiszewski b8c751e300 Drop some unnecessary includes 2021-10-09 21:30:24 +02:00
Duncan fd18ac7f85
Modify StaffSetPatrolAreaAction to have three modes (#15494)
* Modify StaffSetPatrolAreaAction to have three modes

* Actually serialise mode

* Apply review comments

* Increment network version

* Apply review comment

* Update replay
2021-10-07 18:02:24 +01:00
ζeh Matt c054967230
Merge pull request #15530 from ZehMatt/refactor/wallplaceaction-result
Refactor action result passing for WallPlaceAction
2021-10-06 08:50:57 -07:00
ζeh Matt 976d15ce10
Merge pull request #15529 from ZehMatt/refactor/smallsceneryplaceaction-result
Refactor action result passing for SmallSceneryPlaceAction
2021-10-06 08:32:16 -07:00
ζeh Matt d2ffeaa7b0
Refactor action result passing for WallPlaceAction 2021-10-06 18:31:09 +03:00
ζeh Matt 9cb26f7b02
Refactor action result passing for SmallSceneryPlaceAction 2021-10-06 16:12:37 +03:00
ζeh Matt 8effeb26b0
Refactor action result passing for StaffHireNewAction 2021-10-04 17:01:27 +03:00
ζeh Matt cf7b4ded08
Move static declaration into cpp file 2021-10-03 21:13:04 +03:00
ζeh Matt dc44d1f79d
Merge pull request #15511 from ZehMatt/refactor/ridecreateaction-result
Refactor RideCreateAction result data passing
2021-10-03 07:55:14 -07:00
ζeh Matt 24ec2e1b67
Merge pull request #15510 from ZehMatt/refactor/largescenerayplace-result
Refactor LargeSceneryPlaceAction result data passing
2021-10-03 07:54:59 -07:00
ζeh Matt 76c2f9db85
Refactor LargeSceneryPlaceAction result data passing 2021-10-02 00:56:59 +03:00
ζeh Matt 2597c04eb4
Refactor RideCreateAction result data passing 2021-10-02 00:50:03 +03:00
Hielke Morsink 1d62a902e7
Make scenery_small_entry_has_flag a member function (#15509) 2021-10-01 16:50:05 -03:00
Michael Steenbeek 317e562845
Merge pull request #15495 from ZehMatt/refactor/xyz-access
Use GetLocation in more places
2021-10-01 14:02:34 +02:00
Hielke Morsink 94144bcd89
Remove some dead code
Reported by clang
clang-analyzer-deadcode.DeadStores
2021-09-30 10:40:32 +02:00
Michael Steenbeek 987174e828
Merge pull request #15436 from duncanspumpkin/staff
Small Staff Refactor from NSF
2021-09-29 20:46:24 +02:00
frutiemax 2906cb8c89
Fix #14474: Map size can be synced in multiplayer (#15312)
* Fix #14474: Map size can be synced in multiplayer

* Bump up network version

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2021-09-29 16:46:03 +01:00
ζeh Matt eb2de0222b
Use GetLocation in more places 2021-09-28 03:16:04 +03:00
Michael Steenbeek f7d61c67e6
Fix arbitrary ride type cheat not working 2021-09-26 16:21:34 +02:00
Michael Steenbeek 1feac16bed
Merge pull request #15414 from frutiemax/develop
#15367: Encode RideType in TrackElement
2021-09-25 12:02:08 +02:00
Hielke Morsink 53c22c9b4b
Check for nullptr explicitly (#15458) 2021-09-24 20:05:50 +02:00
ζeh Matt 719a5a9d8e
Merge pull request #15369 from ZehMatt/refactor/tile-coords
Refactor overload map_get_first_element_at
2021-09-21 14:36:03 -07:00
frutiemax 355019f97f
#15367: Encode RideType in TrackElement 2021-09-21 10:49:28 +02:00
duncanspumpkin ce75fbcae9 Fix graphics issues with staff fire 2021-09-19 09:17:11 +01:00
duncanspumpkin 6295473c94 Fix merged patrol area bug 2021-09-19 09:15:10 +01:00
duncanspumpkin 5b92f3f9ae Fix conversion error 2021-09-19 09:05:29 +01:00
duncanspumpkin ca689c3948 Introduce methods from NSF
These methods still call the same legacy functionality for now
2021-09-19 08:28:25 +01:00
Hielke Morsink 77141f57b0
Merge pull request #15416 from Broxzier/refactor/unnecessary-else
Remove unnecessary else blocks
2021-09-17 14:56:30 +02:00
ζeh Matt de85a1788b
Merge pull request #15412 from ZehMatt/refactor/ga-results
Allow game actions to store custom data instead of using inheritance
2021-09-16 14:35:03 -07:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Gymnasiast bdab3219cb
Modify object loading for JSON-only objects 2021-09-15 11:28:39 +02:00
ζeh Matt 42254d774d
Allow game actions to store custom data instead of using inheritance 2021-09-14 20:25:37 +03:00
IntelOrca 4f319d6ed4
Prepare footpath handling for surfaces and railings 2021-09-12 17:52:01 +02:00
ζeh Matt b733e97bfa
Remove numerics from common.h and use it as needed 2021-09-11 20:21:08 +03:00
ζeh Matt 516232e0a7
Change static casts to EnumValue 2021-09-10 19:10:15 +03:00
ZehMatt 3ad72baaae
Cast fixes 2021-09-10 19:10:12 +03:00
Michael Steenbeek 624a32e93b
Make Coords isNull/setNull functions TitleCase (#15382) 2021-09-08 20:48:53 -03:00
ζeh Matt 07a7946caf
Remove redundant conversions 2021-09-07 22:36:16 +03:00
Gymnasiast 4cc717ccdb
Rework path surface and railings descriptor handling 2021-09-05 19:09:09 +02:00
Michael Steenbeek a40cfae0ff
Merge pull request #15313 from frutiemax/13874_TrackDefinitions
Part of #13874: Add definition field in TrackElementDescriptor
2021-09-05 16:10:11 +02:00
Michael Steenbeek 2f3d4c6861
Merge pull request #15327 from spacek531/rename-ride-validate-function
Some housekeeping
2021-09-05 13:26:56 +02:00
spacek531 ebc201aaf2 comment and rename
refactor to class method

fix formatting

rename function

rename another

rename sub_6C683D

rename loc_6CD18E

annotate ride_get_entrance_or_exit_position_from_screen_position

fix format

rename loop value

fix formatting again

rename functions to TitleCase
2021-09-02 19:47:22 -07:00
Ted John 3c451a4af4
Use music objects instead of IDs 2021-09-01 10:26:23 +02:00
frutiemax 7e5e9bdf13 Part of #13874: Add definition field in TrackElementDescriptor 2021-08-29 20:22:48 -04:00
Michael Steenbeek 4bbee1c6ae
Merge pull request #15261 from frutiemax/13874_refactor
Track Element Descriptor refactor (issue #13874)
2021-08-29 22:38:46 +02:00
ζeh Matt b367f74496
Fix #15199: Construction window is not closed when a ride gets demolished 2021-08-29 22:20:30 +02:00
frutiemax 450bf61ee4 Part of #13874: TrackSequenceProperties, Pricing and MirrorMap renamed 2021-08-29 10:45:17 -04:00
frutiemax b3744f129f Part of #13874: Avoid copies of ted 2021-08-28 18:57:46 -04:00
frutiemax 5f438535ad Part of #13874: Gymnasiast review 2021-08-27 17:57:10 -04:00
frutiemax 046c060e74 Part of #13874: Replace Track Sequence properties 2021-08-22 18:01:03 -04:00
frutiemax a29b369ff8 Part of #13874: Replace Sequence Element Wall table 2021-08-22 17:58:52 -04:00
frutiemax 382315b2c3 Part of #13874: Replace block tables 2021-08-22 17:57:56 -04:00
frutiemax b5219d76d8 Part of #13874: Replace pricing tables 2021-08-22 17:55:17 -04:00
frutiemax 1bfa26e4c5 Part of #13874: replace flags table 2021-08-22 17:51:35 -04:00
frutiemax 80418efafb Part of #13874: Replace TrackCoordinates 2021-08-22 17:49:00 -04:00
ζeh Matt 3ab70b200b
Fix #15255: Wall banner index defaults to 0 instead of null type 2021-08-21 19:24:09 +02:00
Duncan 223b926f8c
Use std::vector for ride use memory (#14884)
* Use std::vector for ride use memory

* Use new system for import/export

* Remove legacy field

* Add replay entity size protection to prevent crash

* Increment network version

* Update replays

* Move function to header

* Move constant to RCT12 header as used for both 1 and 2

* Align naming with nsf
2021-08-17 21:29:35 +01:00
Duncan 940cab87d3
Map size refactors from NSF (#15112)
* Support large map sizes

* Fix top spin painting

* Fix crooked house

* Increase bb size

* Decrease limit back

* Clang format

* Remove asserts and apply review comments

* Fix rebase mistake

Co-authored-by: Ted John <ted@brambles.org>
2021-08-16 20:51:16 +01:00
Michael Steenbeek 8993e4d062
Use ObjectEntryIndex for entrance style 2021-08-15 22:54:43 +02:00
ζeh Matt 175394f15b
Fix #15193: Crash when rides/stalls are demolished 2021-08-15 14:28:08 +02:00
Michael Steenbeek b4f3923162
Name byte_9D8150 2021-08-08 18:10:52 +02:00
Michael Steenbeek 3c86d56933
Merge pull request #15129 from ZehMatt/refactor/clang-tidy-01
Minor cleanup
2021-08-02 22:04:08 +02:00
Ted John 70d9c1438e
Change most things and formatting to money64 2021-08-01 15:14:42 +02:00
Duncan 465d1c5414
Cleanup of Banner related actions (#15126)
* Close #15107. Use correct type and provide appropriate error messages

* Add further error messages to actions

* Apply review comments
2021-07-30 20:53:13 +01:00
ZehMatt fbc689818e
Default initialize ErrorMessageArgs in GameAction Result 2021-07-30 21:31:10 +03:00
ζeh Matt 43b7c3a204
Fix potential nullptr dereference (#15134) 2021-07-30 14:33:48 -03:00
Michael Steenbeek 0b6e80c7d4
Add error message body to failed Place Park Entrance action 2021-07-27 23:50:16 +02:00
Duncan e9eb1b8304
Banner Refactor from NSF (#14788)
* Banner refactor

* Fix mistake in fix_duplicated_banners

* Reduce limit back

* Fix export

* Free banner on delete

* Increment network version

* Fix potential banner pointer crashes

Co-authored-by: Ted John <ted@brambles.org>
2021-07-27 10:25:58 +01:00
ZehMatt e4758df2e9
Fix #15048: Crash removing litter from cheats 2021-07-22 22:14:12 +03:00
Duncan bbef85e752
Fix #15028, #15042. Crash when placing large scenery (#15043)
* Fix #15028, #15042. Crash when placing large scenery

When the fragmented tile element limit is reached whilst placing a large scenery ghost the game will perform a reorg of the map elements invalidating tile element pointers. As large scenery are multi tiled this can happen mid action invalidating the pointer that was allocated for the first tile element. Large scenery actions pass back the first tile element pointer to the calling function for use with ghost removal. When this pointer is invalid it causes the crash. The ultimate fix for this would be to create an undo function for actions. As an interim the function has been modified to return the first tile height.

* Update changelog
2021-07-21 13:01:09 +01:00
duncanspumpkin 6116b490eb
Revert place park entrance change
Incorrectly changed. ParkEntrances can go nearer to the edge.
2021-07-19 12:17:23 +02:00
duncanspumpkin ae6657dcdc
Close #14903. Use map_is_edge 2021-07-19 12:17:22 +02:00
Hielke Morsink bd18bce3a7
Reflect actual string in string identifier (#14958) 2021-06-26 10:00:05 -03:00
Michael Steenbeek 8aeb763402
Fix #14871: Crash in TrackPlaceAction::Execute (#14934) 2021-06-21 16:27:14 -03:00
Duncan 7e84e0ef3f
Fix #14893: Crash in MapCheckCapacityAndReorganise() 2021-06-13 13:34:54 +02:00
Michael Steenbeek 474e00d48b
Remove map_can_construct[_with_clear]_at() and gMapGroundFlags 2021-06-13 10:13:13 +02:00
Michael Steenbeek f9ad9ad3a5
Merge pull request #14868 from Gymnasiast/refactor/reduce-g-game-command-error-text
Reduce usage of gGameCommandErrorText
2021-06-10 13:21:32 +02:00
Jamie Quigley 4f6d0a00fd
Refactor RIDE_STATUS to use strong enum (#14840)
* Refactor RIDE_STATUS to use strong enum

* Change platform-specific code to match RIDE_STATUS refactor

* Re-added check for valid RideStatus value

* Fixed errors in "g2" build target

* Use EnumValue instead of static_cast<uint8_t>

* Revert rct{1,2}.h to use uint8_t.

* Fix formatting

* Reverted from constexpr variable to additional enum variant

* Fix formatting
2021-06-10 07:09:58 +01:00
Gymnasiast 2da64715cc
Directly call MapCanConstructWithClearAt() 2021-06-09 19:26:11 +02:00
Michael Steenbeek 1031be9078
Fix #14751: Height limitation also affects trees 2021-06-08 22:02:17 +02:00
duncanspumpkin b2c0c3e246 Handle reaching tile element limits more gracefully 2021-06-06 08:28:07 +01:00
Duncan c34079acee
Refactor LargeSceneryEntry and remove rct_scenery_entry (#14816) 2021-06-04 12:41:23 +01:00
Duncan 12c5484f44
Refactor SmallSceneryEntry (#14815) 2021-06-03 22:14:41 -03:00
Duncan 8f59fe91cb
BannerSceneryEntry Refactor (#14810)
* Refactor BannerSceneryEntry to enforce type

* Remove old comment

* Fix incorrect renameing
2021-06-03 21:43:30 +01:00
Duncan 6f81248084
Rework and refactor PathBitEntry (#14809) 2021-06-03 21:23:00 +01:00
Duncan 425f968a67
Rearrange WallSceneryEntry to enforce types (#14808)
* Rearrange WallSceneryEntry to enforce types

* Clang format

Correct inverted nullptr check
2021-06-03 13:26:00 +01:00
Duncan 7253b92cfd
Use correct function call for WallPlaceAction plugin visitor (#14806)
* Use correct function call for WallPlaceAction plugin visitor

* Increment plugin version

* Update changelog
2021-06-02 21:30:49 +01:00
Emre Aydin ac80ca7b46 Refactored code to use a constant for max circuits 2021-06-02 17:48:09 +03:00
Duncan b7e7915efa
Merge pull request #14780 from duncanspumpkin/sprite2
Sprite Refactor 2: Moving around EntityTweener and misc
2021-06-01 20:10:17 +01:00
Michael Steenbeek 31848b195e
Close #14765: Rename gCheatsFastLiftHill 2021-05-29 18:41:16 +02:00
duncanspumpkin 98f9f24909 Remove sprite.h includes where possible 2021-05-29 08:54:33 +01:00
Duncan 39fcc5d078
Split up Sprite header (#14764)
* Remove fields from rct_sprite union

* more header fun

* Fix guest include
2021-05-29 06:01:32 +01:00
Matt 2b4b204ad8
Fix #14724: Money was ignored for ride creation 2021-05-23 19:58:47 +03:00
ζeh Matt 38c7a70025
Fix #14710: Preview not shown without enough money (#14711)
* Fix #14710: Preview not shown without enough money

* Bump up network version

* Add changelog.txt entry
2021-05-23 09:45:48 -03:00
Duncan d22afe2372
Merge pull request #14625 from ZehMatt/refactor/peep
Rename PeepActionType None1/None2
2021-05-13 18:15:54 +01:00
Matt 4c11e11fe2
Rename PeepActionType None1 and None2 2021-05-13 18:05:55 +03:00
duncanspumpkin c345396765
Move duck method into class 2021-05-13 16:09:26 +02:00
Duncan 816bf827ab
Split off a number of entity files into separate headers (#14629)
* Split off a number of entity files into seperate headers

* Get compiling

* Update copyright date
2021-05-13 07:56:24 +01:00
Ryan eb9ed63b0e
Fix some actions for plugins (#14607)
* Fix some actions for plugins

If an action doesn't have an AcceptParameters method, the paramaters passed in executeAction will be ignored and the action will fail.

* Change plugin parameter names

* Increment plugin API version
2021-05-09 22:04:03 +01:00
Michael Steenbeek c9943ee11d
Merge pull request #14458 from Gymnasiast/backport-nsf
Backport ride limit refactors from new-save-format
2021-04-20 23:25:53 +02:00
Duncan 8eabdf8c8f
Split guest and staff peep variables (#14462)
* Split guest and staff peep variables

* Move variable location

* Increment network version

* Update replays
2021-04-18 17:48:21 +01:00
Gymnasiast d857dca36d
Replace hardcoded max number of trains per ride 2021-04-16 18:56:16 +02:00
Michael Steenbeek bbf33b6577
Fix serialisation of PlaceParkEntranceAction 2021-04-15 21:32:26 +02:00
Gymnasiast 084bfe0d48
Remove global from PlaceParkEntranceAction 2021-04-14 15:03:09 +02:00
Michael Steenbeek 7344b7fbfd
Use 16-bit ride_id_t thoughout and raise RIDE_ID_NULL (#14411)
* Replace RIDE_ENTRY_INDEX_NULL with OBJECT_ENTRY_INDEX_NULL

Ride entries are objects like any other, so there is little point having separate constants.

* Use ride_id_t in many more places

* Change RIDE_ID_NULL to 0xFFFF

* Increment network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-04-01 16:02:57 +01:00
Duncan 0a47d2157a
Use more specific types where appropriate (#14388)
It takes marginally more time to get a Peep than a Guest/Staff so may as well go straight to the correct type
2021-03-25 08:44:25 +00:00
Duncan 977d05ba29
Entity type5: Remove peep assigned type (#14380)
* Remove users of AssignedPeepType

* Remove AssignedPeepType

Field no longer required due to changes to EntityType

* Move enum to the RCT12 header

* Increment network version

* Update replays
2021-03-24 08:54:05 +00:00
Maximilian Bottin 6f28914f61
Fix #14296: Allow early scenario completion in multiplayer 2021-03-18 20:30:11 +01:00
Duncan df7a284822
Entity type 2: Remove sprite_identifier (#14334)
* Start changing the underlying type

* Further work

* Complete refactor

* Further cleanup

* Remove pointless check

* Increment network and plugin versions

* Add defaults

* Further defaults

* Fix test paint

* Update replays
2021-03-17 08:04:41 +00:00
Duncan 6ec379cd0e
Split Entity Lists by Entity type (#14326)
* Make initial changes to add entity type

* Make further corrections

* Revert header changes

* Fix mistakes
2021-03-16 11:18:06 +00:00
Duncan 5474194905
Implement train view and remove linked_list_index (#13956)
* Make train manager view

* Remove linked list index field

* Remove merge mistake

* Fix further rebase errors

* Rename and add comments

* Update replays

* Fix Xcode project

* Increment network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-15 08:13:00 +00:00
Michael Steenbeek 28c680f97f
Merge pull request #14163 from Gymnasiast/refactor/get-rtd
Use GetRideTypeDescriptor() in more places
2021-02-26 10:46:38 +01:00
Gymnasiast 44d0e77afb
Make all access to RTD table use the bounds checking function 2021-02-26 10:01:00 +01:00
Gymnasiast f118b2ede4
Replace ride_type_has_flag() with retrieving RTD 2021-02-26 09:49:09 +01:00
Gymnasiast b1ab20ec27
Replace loose flag checking with helper function 2021-02-25 23:04:40 +01:00
Michał Janiszewski ac6e4fc0d6 Move SPRITE_INDEX_NULL, MAX_SPRITES to their new homes 2021-02-25 10:56:27 +01:00
Michał Janiszewski 67b61478cf Reduce inclusion of EntityList.h 2021-02-25 10:56:27 +01:00
Michał Janiszewski 6baff43f52 Reduce inclusion of Sprite.h 2021-02-25 10:56:27 +01:00
Michał Janiszewski 8ee49ab615 Reduce inclusion of world/Sprite.h 2021-02-25 10:56:27 +01:00
Gymnasiast d63e3b1d9f
Replace RideTypeDescriptors[ride->type] with GetRideTypeDescriptor() 2021-02-24 14:10:30 +01:00
Gymnasiast 56399e7188
Use the RTD instead of ride_type_has_flag() 2021-02-24 14:10:30 +01:00
Michael Steenbeek 8e414a9d97
Merge pull request #14121 from ZehMatt/refactor/tileinspector
Refactor Tile Inspector
2021-02-22 11:07:46 +01:00
Duncan 2b26e423e4
Remove AsGuest and AsStaff duplicated functions 2021-02-21 13:23:31 +01:00
Matt 62a01fe043
Move tile inspector code into TileInspector namespace 2021-02-19 18:12:22 +02:00
Gymnasiast a28c22866c
Remove stray semicolon 2021-02-18 17:50:19 +01:00
Gymnasiast 1b964c0f2e
Refactor flat ride track pieces 2021-02-18 17:50:19 +01:00
ζeh Matt 34b1506c5d
Fix #14058: Ride entry or exit can not be built in multiplayer (#14064) 2021-02-12 15:54:32 +00:00
Matt 7d517caced
Move peep pickup test into Peep::CanBePickedUp 2021-02-09 00:31:29 +02:00
Matt 8bfda5cab1
Use correct condition 2021-02-05 20:08:51 +02:00
Matt 35e52acd7d
Remove unused variable 2021-02-05 18:41:20 +02:00
Matt 93e22d6770
Use TileElementsView for WallRemoveAction 2021-02-05 17:34:05 +02:00
Matt ddd67db1d2
Use TileElementsView for SmallSceneryRemoveAction 2021-02-05 17:28:18 +02:00
Matt 83221d51aa
Use TileElementsView for RideEntranceExitRemoveAction and cleanup 2021-02-05 17:25:07 +02:00
Matt 5e2e7143cd
Use TileElementsView for LargeSceneryRemoveAction and cleanup 2021-02-05 17:10:17 +02:00
Matt 5bd6ba25b7
Use TileElementsView for LandSetRightsAction 2021-02-05 16:59:04 +02:00
Matt cf91a13d1e
Use TileElementsView for LandSetHeightAction 2021-02-05 16:54:50 +02:00
Matt dc1c3fe451
Use TileElementsView for FootpathPlaceAction 2021-02-05 16:44:05 +02:00
Matt a7b8978f6e
Use TileElementsView for BannerRemoveAction 2021-02-05 16:38:39 +02:00
Matt 5caa6abc85
Use TileElementsView for BannerPlaceAction 2021-02-05 16:33:40 +02:00
Matt 1aa75f04b7
Add templated version for tile element insertion and cleanup code 2021-02-05 12:22:34 +02:00
Matt 71174b8de7
Make the insertion of tile elements type explicit 2021-02-04 19:00:59 +02:00
Duncan 9d3f3fa224
Fix #13234. Check for correct peep state when removing mass (#13983)
* Check for correct peep state when removing mass

* Add apply mass function

* Increment network version

* Fix #13234. Add to changelog
2021-02-03 09:13:56 +00:00
Ted John 2f39442d25 Implement ride music objects and refactor 2021-01-27 18:45:27 +00:00
Duncan 8c5cd61b69
Split free id's into seperate vector (#13924) 2021-01-26 07:42:56 +00:00
Michael Steenbeek 20f959c833
Use track_type_t in more places 2021-01-22 11:33:55 +01:00
Duncan 354a131892
Use specific type for peep list access (#13831)
* Use specific type for peep list access

* Simplify calculation further
2021-01-19 17:57:22 +00:00
ζeh Matt f1ea718ded
Fix #13832: Game action position is invalid on opening/closing a ride 2021-01-14 10:13:32 +01:00
skdltmxn 7ef4d7762f
Refactor to avoid unnecessary copies (#13736)
* Refactor to avoid unnecessary copies

* Fix dangling references
2021-01-11 18:14:15 -03:00
Michael Steenbeek 60d1e94046
Close #7059: Implement landscape doors on Ghost Train (#13636)
* Implement landscape door updating

* Implement door drawing for Ghost Train

* Amend changelog and bump network version

* Apply review requests

* Always return default seat rotation for ride types with landscape doors

* Fix comment

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-01-10 21:38:02 +00:00
Mathias Gibbens b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Michael Steenbeek 1da6ae6b51
Merge pull request #13710 from skdltmxn/refactor/string_view
Refactor/string view
2021-01-10 13:37:01 +01:00
skdltmxn b0a8ebc808
Refactor to use push_back more efficient (#13726) 2021-01-08 20:59:55 +00:00
Mathias Gibbens 115c92996b
Fix spelling typos (#13730) 2021-01-08 20:13:00 +01:00
skdltmxn c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
Michael Steenbeek ac6cc9d63e
Fix #13609: Crash in LargeSceneryRemoveAction.cpp (#13663) 2021-01-02 15:06:51 +01:00
Michael Steenbeek 1b686816db
Move tile element banner functions to methods 2021-01-02 11:28:39 +01:00
Mike Jones 4e991beb8d
Closes #12419: Merge MISC_COMMAND and GAME_COMMAND into strong enum (#13103)
Merge MISC_COMMAND and GAME_COMMAND enums

Cleanup
2020-12-22 20:53:37 -03:00
Hielke Morsink cc6b56f1f5
Fix: Load game / Quit to the menu are not working in multiplayer (#13619) 2020-12-21 19:55:29 +00:00
Tulio Leao 8fc167afc3
Move some game actions logic from header to source (#13571)
* Moving all definitions from B...Actions to source

* Moving all definitions from C...Actions to source

* Moving all definitions from F...Actions to source

* Moving all definitions from G...Actions to source

* Moving all definitions from L...Actions to source

* Moving all definitions from M...Actions to source

* Moving all definitions from N...Actions to source

* Moving all definitions from P...Actions to source
2020-12-13 15:10:26 +00:00
Michael Steenbeek abd7babc86
Get RTD from ride via a struct method, part 1 2020-12-12 22:53:50 +01:00
Tulio Leao 9ef4931982
Move remaining game actions logic from header to source (#13573)
* Moving all definitions from R...Actions to source

* Moving all definitions from S...Actions to source

* Moving all definitions from T...Actions to source

* Moving all definitions from W...Actions to source
2020-12-12 07:18:38 +00:00
Adam f09b14ef2b
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
Jamie Quigley 03a9ac9f56
Close #12387: Refactored PeepThoughtType to use strong enum. (#13541) 2020-12-07 19:48:36 +00:00
Łukasz Pękalski 3de233c796
Close #12395: Refactor PeepItem to use strong enum (#13311)
* refactor: integrated PEEP_ITEM into SHOP_ITEM

* refactor: converted merged enum to flag

Only former occurrences of PEEP_ITEM

* cleanUp: code cleaned after merging

* refactor: converted ShopItem to strong enum

code reformatting

* refactor: ShopItem enum items renamed

code formatted

* refactor: new getter and setter functions for Item...Flags

* refactor: replaced all occurrences of ItemStandardFlags

with appropriate getter and setter functions.
COMPARE_FIELD macro needs to be commented out or the flag has to stay public.

* refactor: all occurrences of ItemExtraFlags replaced

with proper function calls. COMPARE_FIELD macro issue not resolved.

* refactor: introduced new variable for unified item flags

* refactor: adapted accessor functions

accessor functions were modified to accommodate both standard and extra ShopItem flags

* refactor: ItemExtraFlags accessor functions are replaced

with general functions

* refactor: reverted to original uint32_t flag variables

* refactor: implemented suggested changes

* refactor: integrate additional comments

* refactor: incorporated requested changes

* refactor: incorporated requested changes

added static_cast<PeepThoughtType> in lines 1572 and 1590
2020-12-03 21:15:59 -03:00
Nick 67f5ce62b3
Plugins - return result from StaffHireAction (#13459)
* Added some scripting glue to StaffHireNewAction

* Update src/openrct2/scripting/ScriptEngine.cpp

Co-authored-by: Ted John <ted@brambles.org>

* Update plugin api version

Co-authored-by: Ted John <ted@brambles.org>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-11-26 16:37:07 -03:00
Duncan b5101d085d
Add further plugin visitors for actions (#13458)
* Add further plugin visitors for actions

* Update PLUGIN_API_VERSION

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-11-26 16:13:10 -03:00
Ghlen Nagels 8c55d1ea9f
Close #12446: Refactor WEATHER to use strong enum (#13434) 2020-11-22 17:34:30 +00:00
Michael Steenbeek 23871de19f
Remove built-in explode guests cheat 2020-11-16 22:07:52 +01:00
Łukasz Pękalski dc93cacbee bugHunt: correcting code to compile
code does not compile yet
2020-11-11 16:07:01 +01:00
Łukasz Pękalski 6e5105ab3b refactor: ObjectType to use strong enum
enum renaming complete
2020-11-11 16:07:01 +01:00
Gymnasiast a3aef90637
Replace loose usages of 0xFF 2020-11-07 12:58:32 +01:00
Gymnasiast d58a8d1184
Change tile_element_get_ride_index() to method 2020-11-07 12:58:32 +01:00
Michael Steenbeek 92a5f1aa24
Merge pull request #13310 from ju-pinheiro/sprite-identifier-strong-enum
Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum
2020-11-06 16:55:01 +01:00
Michael Steenbeek eea57f2bfe
Create calls for min/max cars per train 2020-11-05 17:42:02 +01:00
Manuel Vögele 96ff1894ee
Remove unnecessary parameter from Ride::Open (#13368)
Ride::Open is only ever called with RIDE_STATUS_OPEN,
so the parameter is redundant.
2020-11-04 11:24:32 +00:00
Sadret c602db27fd
Close #13057: Make GameAction flags accessible by plugins. (#13359) 2020-11-03 15:43:43 +00:00
Sadret c2d309af38
Close #13346: Change FootpathScenery to FootpathAddition (#13350) 2020-11-03 08:17:29 +00:00
Michael Steenbeek 4ea6f8099f
Merge pull request #13319 from manuelVo/rename-ride_is_valid
Rename ride_is_valid_for_test/open and update return type
2020-11-01 20:49:55 +01:00
Duncan dcabc8451e
Fix #13250: Crash when opening parks with new ride types (#13256)
This only happens when a new ride type is added and the park is opened in the older version of the game where the ride type does not exist.

Reworked so that invalid rides are not loadable. Force reload of title if current scenario is corrupted.
2020-11-01 14:49:43 +01:00
Manuel Vögele 1f7d73a741
Fix #13306: Restore entrance/exit for prebuilt ride design ghosts (#13309)
This fixes a regression introduced in c440dac
2020-10-31 12:27:38 +00:00
Manuel Vögele d0e5a5ab6e Move ride_open and ride_test into Ride 2020-10-28 18:13:37 +01:00
Manuel Vögele eaa340dd92 Rename ride_is_valid_for_test/open and update return type 2020-10-28 15:31:24 +01:00
ju-pinheiro bb16ca075b Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum 2020-10-27 13:26:27 -03:00
Manuel Vögele 838cd4fc56
When placing a block brake perform full operation mode switch 2020-10-26 22:48:43 +01:00
Manuel Vögele e4e7a0f2f2
Fix desync caused due to ghost tiles changing the ride mode 2020-10-26 21:36:09 +01:00
Manuel Vögele c440dac600
Fix #12368: Don't modify station properties when placing ghost tiles 2020-10-26 21:35:44 +01:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
aw20368 0c195d14b9
Close #8848 Refactor TimeInPark (#13146)
Split TimeInPark into a union: ParkEntryTime for guests, HireDate for staff
2020-10-12 21:36:38 -03:00
Duncan 84c9ff833a
Move formatter to separate file. Rework GetMeasurement (#13131)
* Move formatter to seperate file. Rework GetMeasurement

* Add Formatter source files to Xcode project

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-10-09 08:02:07 -03:00
Tulio Leao 32c2b7d449
Merge pull request #13122 from vjavs/strong-enum/PeepSpriteType
Refactor PeepSpriteType to use strong enum
2020-10-08 23:48:45 -03:00
Vinicius Sa 01d237ad27
Use helper function GetSpriteBounds
It's intended to retrieve a rct_sprite_bounds from the global array
g_peep_animation_entries, given PeepSpriteType and PeepActionSpriteType
as parameters.
2020-10-07 17:34:27 -03:00
Vinicius Sa 4d28901cb0
Refactor PeepSpriteType to use strong enum
Issue: 12396
2020-10-07 17:34:21 -03:00
ζeh Matt 61b510db66
Merge pull request #13073 from ZehMatt/refactor/audio-cleanup
Minor cleanup around audio code
2020-10-07 21:18:59 +03:00
Tulio Leao a1b058f648
Fix #10186: Placing multiple saved rides ignores design name (#13120) 2020-10-07 12:45:19 -03:00
Matt 091145037e
Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +03:00
Vinicius Sa bd8c633ea3
Close #12394: Refactor PeepNauseaTolerance to use strong enum (#13106) 2020-10-05 22:13:44 -03:00
Matt 0d43f1fd91
Directly use enums for serialisation 2020-10-03 06:15:13 +03:00
Matt 13f332d5b8
Ensure/Cleanup member initialization for game actions 2020-10-03 05:58:57 +03:00
Matt 82916f6824
Use default constructor 2020-10-03 05:55:33 +03:00
Julia Pinheiro 6a76547c5b
Close #12412: Refactor PROMPT_MODE to use strong enum (#13076) 2020-10-02 23:04:59 -03:00
Tulio Leao 0981b49e99
Fix #8957: Error title missing when building w/ insufficient funds (#13020) 2020-10-01 23:19:34 -03:00
Tulio Leao 29955f28e0
Merge pull request #12976 from mwnciau/Refactor-TRACK_ELEM-enum
Refactor TRACK_ELEM_* enum
2020-10-01 22:05:44 -03:00