* 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
* 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.
* 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
* 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>
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).
- 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
`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.
* 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
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.