Commit Graph

72 Commits

Author SHA1 Message Date
Sadret c602db27fd
Close #13057: Make GameAction flags accessible by plugins. (#13359) 2020-11-03 15:43:43 +00:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
Duncan 353c02b596
Add visitors for all scenery placement and removes (#12886)
* Add visitors for all scenery placement and removes

This should allow greater flexibility for plugin developers

* Add CoordsXYZ visitor

* Increment plugin API version. Update changelog
2020-09-10 15:15:46 -03:00
Duncan c0255efeaa
Create an enum class serializer (#12810)
* Create an enum class serializer

* Make visitor work again

* Make suggested changes
2020-09-03 21:55:46 +01:00
Duncan bb34213b93
MapCanConstructAt refactor (#11977)
* Start using MapCanConstructAt

* Fix #11675. Pass the full error message arguments on peep pickup

This was causing a crash as the error message arguments were being cleared which would mean eventually a nullptr dereference would happen.
2020-06-17 22:35:13 +01:00
Duncan 50d22ededd
Create a hookable location checking function for actions (#11860)
* Create a hookable location checking function for actions

* Add location valid to a number of game actions

Actually pass the coordinates to the script

Use LocationValid on further game actions

Add further actions to the LocationValid. Update api

Update remaining actions to use LocationValid

* Fix bug with peep pickup

Adjust api
2020-06-16 20:57:11 +01:00
Ted John 6c8d199831 Add parameter visitors to ride related actions 2020-05-05 18:00:56 +01:00
Ted John bbe7ff0d80
Refactor game action binding for plugins (#11528)
* Refactor game action binding for plugins

Adds parameter visiting for game actions to reduce code needed for binding game actions to JavaScript objects

* Apply suggestions from code review

Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-04-30 06:56:57 -03:00
Ted John e1c08defc8 Remove use of std::variant 2020-04-26 14:35:07 +01:00
Ted John 83fe0cf5c5 Implement strings for GameAction errors 2020-04-26 14:35:05 +01:00
Michał Janiszewski 5f97637d5e Only suggest final when using non-LTO builds
In LTO builds GCC issues the suggestion-warning from linking stage,
when pragmas are already gone and do nothing.
2020-04-21 13:31:01 +02:00
Matt 52ee9c6896
Use enum class for ExpenditureType 2019-12-22 20:51:55 +01:00
Matt c24112ffad
Refactor out gCommandExpenditureType 2019-12-22 20:51:49 +01:00
Matt 0c11bbd4e7
Fix #9994: Game action tick collision during server connect and map load 2019-10-05 13:09:21 +02:00
Matt 769ed255f3
Refactor game action queue out of network into GameActions 2019-08-21 00:15:39 +02:00
Ted John e4ba170c87 Fix #9699: Crash when error message is shown for custom named ride
Increase size of error string format argument buffer so that the ride name arguments fit.
2019-08-01 17:22:28 +01:00
duncanspumpkin 356a0e5e91 Rework flags 2019-04-04 19:23:44 +01:00
ζeh Matt 521b78390f Fix #8909: Potential crash when invoking game actions as server 2019-03-31 14:42:47 +02:00
Matt 7be312c4c6 Implement rate limiting times for game actions. 2019-03-22 08:06:54 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin c1546a92b7 Implement RideSetVehicleAction
Move all callees to the new action.
Required rework on how the ride type change worked.
2019-02-26 08:14:57 +00:00
Matt 00be865ff1 Use ExecuteNested/QueryNested instead of passing a parameter. 2019-02-15 16:32:11 +01:00
Matt caa490642c Refactor GameActions to allow non-top level actions. 2019-02-15 08:43:05 +01: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 5a8b611b83 Update. 2018-12-29 19:23:28 +01:00
Matt 4ff2dbd108 Automatically expose game action name via macro. 2018-12-20 22:20:58 +01:00
ζeh Matt 1abb31a159 Implement game action logging. (#8138) 2018-11-20 06:04:42 +01:00
Matt ec5ab09943 Fix #7910: Allow game actions while paused if requested from callee. 2018-08-20 17:41:48 +02:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +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
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
Hielke Morsink 5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +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
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Ted John 6a8ea7e8d4 Create helper method to create the game action result 2018-03-20 09:31:39 +01:00
Michael Steenbeek 359e9ecf2d Replace LocationXYZ32 2018-02-16 16:16:49 +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
Ted John 0c71855769 Replace Memory::Copy with std::copy 2018-02-04 12:40:24 +00:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Michael Steenbeek 91589f57c6 Compile map.c as C++ 2018-01-03 20:40:51 +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
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +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
Michał Janiszewski 07dbdfbd34 Make GameActionResult destructor virtual to ensure proper teardown 2017-10-06 07:31:40 +02:00
Michał Janiszewski aba3c270bb Game actions fixes 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
Michał Janiszewski 6ddac382be Fix copyright dates 2017-10-05 10:42:44 +02:00