Commit Graph

1285 Commits

Author SHA1 Message Date
Matt ee00143f3a Throw assert only in debug builds for missing game actions. 2019-02-07 18:23:58 +01:00
duncanspumpkin bca79da193 Check for null id 2019-02-07 11:41:54 +00:00
duncanspumpkin 892d6dc5f7 Be explicit about nullptr checks.
Keep travis happy
2019-02-07 10:16:01 +00:00
duncanspumpkin 11c16955c5 Small refactor to use enum class 2019-02-07 08:14:45 +00:00
duncanspumpkin 201db19d0a Move Ride Set Appearance into action framework 2019-02-07 08:14:45 +00:00
Aaron van Geffen 2a416dce81
Set more maze error messages in MazeSetTrackAction. (#8683) 2019-02-07 00:29:50 +01:00
duncanspumpkin 8a69b89df6 Move Staff Set Orders into game action framework.
Split up costume and order game commands
2019-02-05 20:38:18 +00:00
duncanspumpkin 50b241d20d Add missing include and rework to use Coords 2019-02-05 19:27:30 +00:00
Christopher G. Dolan 19a58fa5fe Fix format, move validation logic to query, update network version 2019-02-04 17:30:45 -08:00
Christopher G. Dolan a8864092c0 fix format and serialize all ivars 2019-02-03 23:02:00 -08:00
Christopher G. Dolan 075983da0f Implement game action for sign set style 2019-02-03 22:20:01 -08:00
Matt 7ad59bbb37 Refactor number values to RIDE_VALUE_UNDEFINED 2019-01-30 14:59:06 +01:00
ζeh Matt 6668a1fa86 Refactor remaining number values to RideStation::NO_TRAIN (#8655) 2019-01-30 13:49:46 +00:00
Ted John 92412d4bab Store ride index inside ride struct 2019-01-18 11:46:18 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Matt 9f613833ce Rename actions. 2019-01-07 09:04:51 +01:00
IntelOrca b9fd90ffd3 Implement ClearAction. 2019-01-07 09:04:51 +01:00
Matt d7096f71cb Implement SceneryRemoveLargeAction. 2019-01-07 09:04:51 +01:00
Matt b34b09c6bb Implement SceneryRemoveSmallAction. 2019-01-07 09:04:51 +01:00
Michael Steenbeek 31298bd772
Merge pull request #8543 from IntelOrca/refactor-ride
Refactor ride structure
2019-01-02 22:38:20 +01:00
Ted John 37f76d1687 Move station fields into new station struct 2019-01-01 02:26:14 +00:00
Matt 38dc762f62 Initialize gCommandPosition with LOCATION_NULL in case its not set. 2018-12-30 00:04:34 +01:00
Matt c7ab757a86 Cleanup. 2018-12-29 23:06:15 +01:00
Matt d3a20df682 Fix track designs ignoring ghost/preview flags. 2018-12-29 19:23:28 +01:00
Matt 14695e9b41 Fix game actions with ghost flags being recorded to replays. 2018-12-29 19:23:28 +01:00
Matt 5a8b611b83 Update. 2018-12-29 19:23:28 +01:00
Matt df0cc72887 Add normalisation support to remove gaps. 2018-12-29 19:23:27 +01:00
Matt bf8108c2d6 Lock game actions and commands to replay commands if replay is active. 2018-12-29 19:23:27 +01:00
Matt a6efef1e81 Add support to record and replay game commands/actions. 2018-12-29 19:23:27 +01:00
Matt 727ba2d7d0 Fix #8333: Replace assert with in-game error. 2018-12-23 22:28:59 +01:00
Michael Steenbeek 2530cd1ac3
Fix #8426: Queue banner left behind after ride demolition 2018-12-22 15:34:17 +01:00
ζeh Matt b572fffafa
Merge pull request #8457 from ZehMatt/refactor/game-action-name
Automatically expose game action name via macro.
2018-12-20 23:17:49 +01:00
Matt 4ff2dbd108 Automatically expose game action name via macro. 2018-12-20 22:20:58 +01:00
Ted John 4195f0d9c9 Change gPeepSpawns to a vector so we can now have more than 2 2018-12-16 19:00:16 +00:00
Ted John 19a687f2fa Change gParkEntrance to a vector so we can now have more than 4 2018-12-16 19:00:16 +00:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
ζeh Matt d88a9048f9 Fix #8431: crash when game action logging is enabled. (#8447) 2018-12-15 18:41:55 +00:00
Michael Steenbeek cf44ea7e24
Fix #3832: Track piece colour scheme paint not network-safe 2018-12-11 22:17:52 +01:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
ζeh Matt 2da01caa1e Fix #8338: GAs using player id instead of index to log money spent. (#8361) 2018-12-05 07:39:57 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
ζeh Matt 1abb31a159 Implement game action logging. (#8138) 2018-11-20 06:04:42 +01:00
Hielke Morsink 107faaf821 Add and use game action for setting the climate
Also reordered the registered game actions the same as headers, so they are easier to find.
2018-11-08 22:39:13 +01:00
ζeh Matt 7831208f42 Fix #8199: Crash using player id as index. (#8210) 2018-11-02 22:48:45 +01:00
ζeh Matt e083116bc7 Fix #8207: ride_create_command ignoring game action result. (#8208) 2018-11-02 21:13:41 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
ζeh Matt 83c3f3a905 Fix #8121: Crash renaming park with server logging enabled. (#8177) 2018-10-28 09:36:18 -07:00
ζeh Matt e5eb61d38d Fix scrolling banners drawing invalid text 2018-10-23 19:44:14 +02:00
Gymnasiast 3738cdaf5e Make CIs happy 2018-09-29 10:51:27 +02:00
Gymnasiast fa67883caf Fix crash and address most line notes 2018-09-27 22:51:56 +02:00
Michael Steenbeek a8e087b560 Return actual entrance elements from map functions 2018-09-27 22:15:04 +02:00
Michael Steenbeek 995c6debf1 Port entrance path type lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek 3c93aca727 Port entrance station index and sequence lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek c7eaa1ba80 Port entrance ride index lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek cc7f8e612d Port entrance type lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek 49506a57cf Fix error in RideDemolishAction.hpp 2018-09-26 11:29:38 +02:00
Michael Steenbeek 3f17782692 Move direct access to maze entry to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek a3e9c63fc3 Move GetRideIndex to struct methods 2018-09-25 21:57:21 +02:00
Gymnasiast ae4c464ce7 Move getting track sequence to struct methods 2018-09-25 21:57:21 +02:00
Gymnasiast 8908f3f47e Move getting track type to struct methods 2018-09-25 21:57:21 +02:00
Christian Schubert 16936d4ea1 Fix #7828: Copied entrances and exits stay when demolishing ride (#7932) 2018-09-23 17:38:59 +02:00
Michael Steenbeek 508276b081 Remove lots of direct access to ->type fields 2018-09-17 15:18:07 +02:00
Michael Steenbeek 74ccf010e6 Port surface elements to new structure 2018-09-16 21:34:51 +02:00
Michael Steenbeek 1d3baef9b7 Remove some C-style tile element functions 2018-09-16 21:34:04 +02:00
Matt e5dd0be813 Remove unnecessary GetActionFlags overrides. 2018-08-20 21:14:32 +02:00
Matt ec5ab09943 Fix #7910: Allow game actions while paused if requested from callee. 2018-08-20 17:41:48 +02:00
ζeh Matt b2005c3b9f Implement FootpathRemoveAction as a GameAction (#7867) 2018-08-12 10:31:00 +02:00
Sijmen Schoon f3f4776afd Properly fix maze building when paused (#7852)
Also fixes two relevant bugs:
- The error message having no title
- Fixes the controls in the construction window activating when the initial placement fails because of e.g. the game being paused.
2018-08-04 14:30:13 +02:00
Sijmen Schoon faa5cc2472 Fix #7823: You can build mazes while paused 2018-08-03 21:58:49 +02:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
Hielke Morsink 472320d8f3 Correct formatting up to the management folder
I went over the commits ab7f22f..8726712 (bulk format commits for game actions to management inclusive) and corrected all mistakes I found. Most of them have to do with arrays missing trailing commas, making clang-format indent the entire array or not add breaks between the values.
2018-07-23 16:00:15 +02:00
clang-format 90f1a328ab clang-format game actions 2018-07-23 15:58:01 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michał Janiszewski 65d1c7f490
Fix and enable -Wtautological-unsigned-zero-compare (#7706) 2018-06-17 22:48:45 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Ted John 9a94139242 Fix Linux builds 2018-06-12 21:18:13 +01:00
Hielke Morsink 7355b497a1 Use new banner index type
BannerIndex is defined in common.h (like some other types such as money32 and rct_string_id), so that banner.h wouldn't have to be includede everywhere. Later on, it may be nicer to have a custom types file instead of putting them all in common.h.
2018-06-11 13:29:41 +02:00
Hielke Morsink 08035f42f7 Fix compilation of SignSetNameAction.hpp
This header was missing some includes that it depends on. Some were included by other headers.
2018-06-11 13:29:32 +02:00
Hielke Morsink ead97a4638 Split colour into union with ride index
The colour field in the banner object is also used to store the ride index when a banner is linked to a ride. This commit turns this field into a union with both named fields, to make the code clearer.

It also changes the return types of related functions to uint8 instead of sint32, and makes use of the RIDE_ID_NULL define where applicable.
2018-06-11 13:21:48 +02:00
Hielke Morsink 5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Michael Steenbeek a14d59028f
Modify some commands to use CoordsXY 2018-06-04 19:18:52 +02:00
Ted John 9d617958cf Return date and park by reference from game state 2018-05-30 13:12:19 +01:00
Ted John 1e7560e7da Do not include GameState.h in Context.h 2018-05-30 12:50:25 +01:00
Ted John f1ee5cad83 Call Park from GameState. 2018-05-30 11:53:32 +02:00
Michael Steenbeek b573bd49b3 Replace all occurrences of tile_element_is_last_for_tile() 2018-05-24 11:44:53 +02:00
Aaron van Geffen ca16fe8e62 Fix refurbishment confirmation window not closing in multiplayer mode. 2018-05-23 16:33:37 +02:00
jensj12 ce0bf28cb5 Fix not enough cash error showing incorrectly 2018-05-23 16:33:37 +02:00
jensj12 50e3f8b4f6 Cleanup of ride_demolish 2018-05-23 16:33:37 +02:00
jensj12 23dc6bb9d3 Add button to refurbish ride
Add a button to refurbish the selected ride. The cost for this is 35% of the
build price and may only be done if the ride is closed and empty.
2018-05-23 16:33:37 +02:00
Aaron van Geffen 3ed6a25bbb
Fix park value regression from #7543. 2018-05-22 11:42:21 +02:00
Aaron van Geffen bfa5bf6ecc Refactor procedural park methods into Park calls. 2018-05-19 20:21:18 +02:00
Hielke Morsink 6c65c3d64d
Merge pull request #6774 from janisozaur/fixes
Various code improvements
2018-05-15 14:38:43 +02:00
Aaron van Geffen 59e682a835
Merge pull request #6807 from ZehMatt/ga-removewall
Refactors GAME_COMMAND_REMOVE_WALL to a GameAction.
2018-05-15 09:54:37 +02:00
Michael Steenbeek fcf507e051
Spin off shop item stuff to separate files 2018-05-14 19:21:43 +02:00
Hielke Morsink 9f0d820b7c Use TileCoordsXYZD for wall locations 2018-05-14 12:36:45 +02:00
Hielke Morsink f9dd981234 Further fixes
- Use `= 0` for initializing types
- Add default values to some structs, instead of zero-initializing their instances with `{}`
- Use `std::make_unique` in Network.cpp
- Remove trivial constructors and destructors
- Improve readability of expression in Vehicle.cpp
2018-05-12 16:58:08 +02:00
ZehMatt cd0530d176 Fix use of missing function. 2018-05-11 23:03:19 +02:00
Michał Janiszewski 0a92e74ced Minor fixes 2018-05-11 15:38:30 +02:00
ZehMatt 30eb844c7f Remove game_command_remove_wall and references. 2018-05-11 12:33:59 +02:00
ZehMatt 5e4cdeb78b Refactor out references to compatibility function wall_remove 2018-05-11 12:33:57 +02:00
ZehMatt 8cb76cd969 Use game action directly when used from different game command/action. 2018-05-11 12:32:16 +02:00
ZehMatt 70ee22bbfa Discard empty errors. 2018-05-11 12:32:16 +02:00
ZehMatt b0f7435e9d Refactor GAME_COMMAND_REMOVE_WALL to game action. 2018-05-11 12:32:14 +02:00
duncanspumpkin fcb66b7449 Start refactoring pathfinding to use tileCoords 2018-05-05 11:42:34 +01:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Michael Steenbeek 5f9d40be7a
Replace tile_element_get_type() with struct method 2018-05-02 19:27:04 +02:00
Michael Steenbeek b725916808 Use TitleCase 2018-05-02 13:27:53 +02:00
Michael Steenbeek ef433df26a Clean up tile element usage, introduce struct methods 2018-05-02 11:58:12 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Ted John 1cd88a1641
Fix #7367: 'invalid name for park' shown when opening a scenario (#7394)
Apply extra changes from my own implementation of ParkSetNameAction
which re-introduces logging and calls the action directly from the UI
layer.
2018-04-10 17:14:32 +01:00
Hielke Morsink a51462b0fd Include necessary files for compiling headers
This commits works towards #7289. It includes files that it depends on, or forward declares types when possible. It may seem like this only increases compilation time, but before this commit they depended on the other includes of the source files that use them.
2018-03-31 23:07:14 +02:00
Hielke Morsink aa7fb35839 Remove use of 'using namespace' from headers 2018-03-30 17:14:10 +02:00
ZehMatt bcbe6ecbff Remove unnecessary include 2018-03-27 16:29:56 +02:00
ZehMatt 417a2586b6 Implement game action for banner naming. 2018-03-27 16:29:53 +02:00
ZehMatt b45609a278 Implement game action for park naming. 2018-03-27 16:29:52 +02:00
ZehMatt 199a3e33f4 Implement game action for sign naming. 2018-03-24 05:19:19 +01:00
Michał Janiszewski af7fd94859 Add missing includes 2018-03-20 09:34:19 +01:00
Ted John 9b604310a2 Implement game action for staff set colour 2018-03-20 09:31:39 +01:00
Ted John 6a8ea7e8d4 Create helper method to create the game action result 2018-03-20 09:31:39 +01:00
Ted John 708843b526 Implement game action for park marketing 2018-03-20 09:31:39 +01:00
Ted John 5a803d2551 Implement game action for park set research funding 2018-03-20 09:31:39 +01:00
Ted John 16a7e21ffa Implement game action for park set loan 2018-03-20 09:31:39 +01:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
Michael Steenbeek 1fa2fa8f80
Refactor ride->entrances and ride->exits 2018-03-07 19:10:50 +01:00
ZehMatt e3708c0593 Split special direction to new parameter. 2018-03-05 00:17:34 +01:00
ZehMatt bdc1cf8adc Refactor GAME_COMMAND_MAZE_SET_TRACK to game action. 2018-03-05 00:17:34 +01:00
Gymnasiast 7a2a73b418 Fix #7205: Park entrance fee cannot be set higher than £100 2018-02-21 22:37:54 +01:00
Michael Steenbeek 2de6529cf5 Use big coordinates for PeepSpawn's Z coordinate 2018-02-21 09:50:07 +01:00
Gymnasiast d92883eee9 Replace NULL with nullptr 2018-02-21 09:50:07 +01:00
wolfreak99 2d8c473f75 Sync Peep Spawn over network 2018-02-19 21:11:14 +01:00
Michael Steenbeek 359e9ecf2d Replace LocationXYZ32 2018-02-16 16:16:49 +01:00
Michael Steenbeek bde913ee16 Rename SmallCoords and BigCoords 2018-02-15 22:26:50 +01:00
Michael Steenbeek 45e892e5b5 Allow passing BigCoordsXY into map_get_surface_element_at() 2018-02-15 22:26:50 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Ted John 0c71855769 Replace Memory::Copy with std::copy 2018-02-04 12:40:24 +00:00
Ted John 7851446a6f Replace Memory::Set with std::fill or similar 2018-02-04 12:35:02 +00:00
Gymnasiast 5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
Hielke Morsink 8fac2e1480 Add guard to ensure game action is registered
This also reorders the headers, which caused RideDemolishAction to fail compiling, but that's also solved by adding the namespace before the call.
2018-01-29 13:22:13 +01:00
Marijn van der Werf 7aa2cd7ac5 Move peep list refreshing to UI module 2018-01-18 22:57:55 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Ted John c3eab7ead6 Refactor window.c to C++ 2018-01-07 12:39:58 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Richard Jenkins 9bb7b66157 Fix #6948 & #6949: Removing or trying to build a ride freezes game 2018-01-06 13:49:29 +00:00
Michael Steenbeek 0430cfb6db Fix #6963: Demolishing ride 0 causes freezes 2018-01-06 14:46:02 +01:00
duncanspumpkin 9e30bfe313 Fix #6954. Readd Error Message for too many rides
Removed during refactor of game actions
2018-01-06 07:48:37 +00:00
Tyler Ruckinger 26c35b5c28 Fix consecutive thoughts removal on ride demolish (#6937)
* Fix consecutive thoughts removal on ride demolish

* Update contributors.md

* Update changelog

* Update network version
2018-01-05 06:49:05 +00:00
Michael Steenbeek 91589f57c6 Compile map.c as C++ 2018-01-03 20:40:51 +01:00
Gymnasiast 1626f86acc Compile park.c as C++ 2018-01-01 01:18:12 +01:00
Gymnasiast 23d70a4ac9 Compile ride.c as C++ 2017-12-31 20:43:17 +01:00
Hielke Morsink 628039dd8a Use range-based for loops in libopenrct2 2017-12-21 23:47:30 +01:00
Michael Steenbeek c4f44e5e7a Compile files in paint folder as C++ 2017-12-17 17:24:36 +01:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Michael Steenbeek 3868b100df Stop encrypting money
It serves no purpose any more. Of course, we still need the ENCRYPT_MONEY() and DECRYPT_MONEY() functions for importing and exporting S6 files.
2017-12-07 23:22:24 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Michael Steenbeek 1011d6172d
Clean up string IDs 2017-11-23 15:52:06 +01:00
Ted John 323b8dd352 Partially fix #6129: Guest List not updating after a ride rename
- Force refresh of ride list and guest list for both rename ride and demolish ride actions.
2017-11-23 09:40:39 +01:00
Marijn van der Werf 3d7867791d Move scenery window to UI module 2017-11-18 21:07:21 +01:00
Michael Steenbeek ce8d9cc71b Rename map_element to tile_element 2017-10-31 19:59:06 +01:00
duncanspumpkin b96657c0cd Fix #6478. Rides can no longer be destroyed during pause mode.
Mistake made during refactoring into GameAction
2017-10-30 12:09:40 +01:00
Robbin Voortman f0b8559341 Lower game actions verbosity 2017-10-27 11:14:37 +02:00
Michael Steenbeek 4290d0a65d Fix some erroneous use of LOCATION_NULL
Found by @janisozaur and introduced in PR #6461.
2017-10-25 11:59:29 +02:00
Michael Steenbeek ce4899c60c Compile station.c as C++ 2017-10-23 14:47:12 +02:00
Duncan d224f1219e Reintroduce error titles to game actions. Small refactor. (#6462)
* Reintroduce error title to game actions. Small refactor.

Removed setting error titles in any calling functions.
Refactored place park entrance result to conform with other game actions.

* Remove unread variable (fixing Travis)
2017-10-18 19:57:36 +01:00
Michael Steenbeek ac7652f61d Create define for MONEY16_UNDEFINED 2017-10-18 08:06:16 +02:00
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +02:00
Michał Janiszewski ab3835719a Compile peep and staff logic as C++ 2017-10-13 10:06:36 +02:00
Michael Steenbeek 3a9dc3f491 Ensure that get_ride_entry returns NULL on invalid ride entries 2017-10-12 21:07:35 +02:00
Michael Steenbeek 17557569d0 Turn 'unlock all prices' into a regular option
This uses a previously unused S6 flag to save this option persistently.
This should not make S6 import much harder, but should reduce the amount of questions about S4 import.

Also refactor the checks whether the user can ask money for rides or entry. This should make it a lot easier
when our own save format comes around.
2017-10-11 08:33:17 +02:00
Duncan 6e1521caec Reintroduce error messages when trying to open invalid rides (#6381)
* Reintroduce error messages when trying to open invalid rides

Mistake made during action refactor. I've added the ability to specify the error title and error args as well in the result constructor. In addition the set status will now perform a query to check if it is valid preventing error messages hitting the server.

* Bring error message setting into the function

This prevents any other function corrupting the message args. Looking at you update ride window.

* Increment network version for error message fix on set status

* Reintroduce the error title to set ride name

* Try not to introduce bugs due to inverting logic
2017-10-09 15:50:49 +01:00
ZehMatt 19f9a9b755 Fix #6394: RideCreateAction not working with empty colour presets. 2017-10-07 20:13:05 +02:00
Michał Janiszewski 07dbdfbd34 Make GameActionResult destructor virtual to ensure proper teardown 2017-10-06 07:31:40 +02:00
ζeh Matt 0423397c34 Fix #6376: RideCreateAction::Query ignores valid secondary colour input 2017-10-05 20:46:50 +02:00
Oli414 d39c80da42 Fix code style. Fix error text 2017-10-05 10:42:44 +02:00
Oli414 59eae9defa Add missing include 2017-10-05 10:42:44 +02:00
Oli414 857faec100 Tabs to spaces 2017-10-05 10:42:44 +02:00
Oli414 0760ea6aa8 Renamed duplicate region 2017-10-05 10:42:44 +02:00
Oli414 8fa82493cb Move set_staff_name game command functionality to game action 2017-10-05 10:42:44 +02:00
Oli414 14f59c3d9b Move set_guest_name game command functionality to game action 2017-10-05 10:42:44 +02:00
Michał Janiszewski 9ff0e22aee Whitespace fixes 2017-10-05 10:42:44 +02:00
ZehMatt d8d7d97f74 Fix references on deprecated GAME_COMMAND_DEMOLISH_RIDE 2017-10-05 10:42:44 +02:00
Michał Janiszewski aba3c270bb Game actions fixes 2017-10-05 10:42:44 +02:00
Michał Janiszewski 540f306809 Provide default values for various scalar fields 2017-10-05 10:42:44 +02:00
Michał Janiszewski 4841e2c6f3 Improve verifying validty of new game action 2017-10-05 10:42:44 +02:00
ZehMatt 1dd5d3a3f5 Verify there is an empty slot for a new ride 2017-10-05 10:42:44 +02:00
Michał Janiszewski 23bfb9b306 Remove superfluous move 2017-10-05 10:42:44 +02:00
Michał Janiszewski b70dd97234 Fix rebase errors 2017-10-05 10:42:44 +02:00
ZehMatt bf0bc77dfc Refactor SetParkEntranceFeeAction to use constructor for parameters.
Add RideSetNameAction.
Support of string serialisation.
Check requested status for ride in Query.
Add RideDemolishAction.
2017-10-05 10:42:44 +02:00
ZehMatt 995c0d0a6b Refactor SetParkEntranceFeeAction to use constructor for parameters.
Add RideSetNameAction.
Support of string serialisation.
2017-10-05 10:42:44 +02:00
ZehMatt ce54b41aba Fix single player pre-designed rides not working.
Move ride_create_command into GameActionCompat
Refactor GameActions to return the GA_FLAGS instead of using the const value.
Refactor passing params to GameActions over constructor.
2017-10-05 10:42:44 +02:00
ZehMatt 89c020d3fe RideCreateAction takes the colours now as input.
Add ride_get_entry_index, same code is used at multiple spots.
Rename variable 'rei' to 'rideEntryIndex'
2017-10-05 10:42:44 +02:00
ZehMatt e78e972de5 Moved some of RideCreateAction checks into the Query member. 2017-10-05 10:42:44 +02:00
Michał Janiszewski cb7c0d1df4 Use std::move for RideCreateAction::Execute
Fixes compilation with ICC and Xcode 8
2017-10-05 10:42:44 +02:00
Michał Janiszewski 6ddac382be Fix copyright dates 2017-10-05 10:42:44 +02:00
Michał Janiszewski 5e523c723f Lift -Wsuggest-final-X for game actions 2017-10-05 10:42:44 +02:00
Ted John d97123073c Backport fixes to ride_create 2017-10-05 10:42:44 +02:00
Ted John ed133df13f Fix build errors 2017-10-05 10:42:43 +02:00
Ted John 4ac8f1dc35 Make the game action callback type safe 2017-10-05 10:42:43 +02:00
Ted John aa30859ab7 Merge IGameAction into GameAction 2017-10-05 10:42:43 +02:00
Ted John 02b77af646 More styling fixes 2017-10-05 10:42:43 +02:00
Ted John ac1e889014 Tabs to spaces 2017-10-05 10:42:43 +02:00
Ted John 675b1b8cf4 Do style fixes 2017-10-05 10:42:43 +02:00
Ted John b068331db2 Move contents of IGameAction.h into GameAction.h 2017-10-05 10:42:43 +02:00
ZehMatt 072ecadd48 Fix leaking memory creating game actions.
Specialized class use for game action results.
2017-10-05 10:42:43 +02:00
ZehMatt 5283804b37 Remove unnecessary type conversation.
Add override attributes.
Changed GameActionResult data storage to union, happy compilers.
2017-10-05 10:42:43 +02:00
ZehMatt c73665a003 Add deprecation warnings in old game_command functions.
Removed line that didn't belong there.
2017-10-05 10:42:43 +02:00
ZehMatt 22750a95e4 Fix using rct_xy8 incorrect. 2017-10-05 10:42:43 +02:00
ZehM4tt f29dc3ff34 Fixed base class serialise not being called.
Implemented RideSetStatus game action.
2017-10-05 10:42:43 +02:00
ZehM4tt 3657122b3b Moved ride create command to new game action system. 2017-10-05 10:42:43 +02:00
ZehM4tt fbd793083c Put action files in headers instead of cpps.
Added callbacks for GameActions and network support for them.
Refactored GameAction registration due static library issues.
Moved all C functions into a single file.
2017-10-05 10:42:43 +02:00
ZehM4tt 1b2a61c6ba Separated out byte swapping into its own header.
Simplified data serialisation of game actions.
Moved the flags away from parameters.
GameAction base now serialises mandatory data such as flags and player.
Split some functions from network in order to move command processing to the end of tick.
2017-10-05 10:42:43 +02:00
Michał Janiszewski 60e72e6dbc Mark GameAction methods as overriding 2017-10-05 10:42:43 +02:00
Michał Janiszewski 2aa7924b30 Add required virtual destructor to IGameAction 2017-10-05 10:42:43 +02:00
ZehM4tt f20a6863cd Simplified registration of game actions and avoid duplicate code. 2017-10-05 10:42:43 +02:00
duncanspumpkin 149a854c51 Make changes to match @ZehMatt code 2017-10-05 10:42:39 +02:00
Michał Janiszewski 634683d891 Mark GameActions::Register as static 2017-10-05 10:42:39 +02:00
duncanspumpkin fd00096b3b Fix tabs spaces 2017-10-05 10:42:39 +02:00
duncanspumpkin 205a1c9e12 Depreciate game command. Fix error messages 2017-10-05 10:42:39 +02:00
Michał Janiszewski 5103113740 Mark Factory variables as maybe_unused 2017-10-05 10:42:38 +02:00
duncanspumpkin 1d3076a2af Initial attempt at getting place entrance into game action 2017-10-05 10:42:38 +02:00
duncanspumpkin 8adcbd6e35 Fix warning 2017-10-05 10:42:38 +02:00
duncanspumpkin df5ea16026 Change function declarations. Move network code into network 2017-10-05 10:42:38 +02:00
duncanspumpkin 254041985f Make servers work 2017-10-05 10:42:38 +02:00
duncanspumpkin ae24ded8bf Make client work 2017-10-05 10:42:38 +02:00
duncanspumpkin 351b0df76b Initial try at adding networking 2017-10-05 10:42:38 +02:00
duncanspumpkin e7c66bb208 Start adding network code 2017-10-05 10:42:38 +02:00
Ted John c483c319fc Make dummy global static 2017-10-05 10:42:38 +02:00
Ted John bb4a482bfc Start writing new game action execution 2017-10-05 10:42:38 +02:00
Ted John 33397005b0 Add tag and flags to game action 2017-10-05 10:42:38 +02:00
Ted John c89a00badd Write initial new game action infrastructure 2017-10-05 10:42:38 +02:00