Commit Graph

43 Commits

Author SHA1 Message Date
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -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
Duncan ea036a38fd
Use MapCanConstructWithClear in LandSetHeightAction (#13037) 2020-10-01 08:41:35 -03:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Michael Steenbeek 97b99122de
Merge pull request #11962 from Gymnasiast/refactor/rtd-rtd-rtd
Move RideNaming, RideHeights and max mass to RTDs
2020-06-17 13:06:26 +02: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
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
Michael Steenbeek be13c1fc87
Refactor more TileCoords 2020-03-07 21:07:18 +01:00
Matt 758a7e432f
Use const reference instead of copy for location structures 2020-02-13 11:53:14 +01:00
Michael Steenbeek d798811c4a Make GetWaterHeight return big Z (#10579)
* Make GetWaterHeight return big Z

* Restore > 0 [ci skip]
2020-01-19 15:12:48 +00:00
Duncan 0702808692
Use a game action result for clear at function (#10576)
* Use a game action result for clear at function

* Clean up callers of set_error_text

* Make it compile

* Make suggested changes

* fix compile

* Fix nullptr deref
2020-01-19 13:14:37 +00:00
Michael Steenbeek 44dc2068e7
Merge pull request #10515 from tupaschoal/use-more-coords-4
Use CoordsXY* on world/Footpath.cpp
2020-01-11 20:52:39 +01:00
Tulio Leao 301e0cfeb1 Use CoordsXYZ on footpath_remove_litter() 2020-01-11 11:13:05 -03:00
Michael Steenbeek 08ab15ef36
Fix #10313: Path furniture can be placed on level crossings 2020-01-05 17:59:02 +01:00
Tulio Leao 8b4e0d7bab Make Map::wall_remove_*() use CoordsXY* (#10461)
* Make Map::wall_remove_at() use CoordsXYRangedZ

* Make Map::wall_remove_at_z() use CoordsXYZ

* Make Map::wall_remove_intersecting_walls() use CoordsXYRangedZ

* Remove useless TODO and simplify functions
2019-12-30 16:51:01 +00:00
Tulio Leao 2d7dccb0c2 Make Map::map_can_construct_*() use CoordsXYRangedZ (#10462)
* Make Map::map_can_construct_with_clear_at() use CoordsXYRangedZ

* Make Map::map_can_construct_at() use CoordsXYRangedZ
2019-12-30 15:00:42 +00:00
Tulio Leao 98110c0544 Make Map::map_invalidate*() use CoordsXY (#10437)
* Make Map::map_invalidate_element() use CoordsXY

* Make Map::map_invalidate_tile_full() use CoordsXY

* Make Map::map_invalidate_tile_zoom0() use CoordsXY

* Make Map::map_invalidate_tile_zoom1() use CoordsXY

* Make Map::map_invalidate_tile() use CoordsXY

* Use CoordsXYRangedZ for map invalidation

* Fix vehicle tile invalidation use Z instead of Y coord

* Fix BannerRemoveAction sending Z TileCoords to invalidate tile

* Fix wrong tile invalidation on peep_update_walking_break_scenery

* Prefer ToTileStart over bitwise and
2019-12-28 08:44:33 +00:00
Tulio Leao 19b7bed37e Use CoordsXY for Map::clear functions (#10439) 2019-12-27 15:58:40 +01:00
ζeh Matt 518780c3e8
Merge pull request #10422 from ZehMatt/refactor/gCommandExpenditure
Refactor out gCommandExpenditureType
2019-12-25 01:49:46 +01:00
Tulio Leao a2c7ecc6e5 Make Map::map_get_first_element_at() use CoordsXY (#10413)
* Make Map::map_get_first_element_at() use CoordsXY

* Fix clang-format on ClearAction.hpp

* Prefer TileDIrectionDelta over hardcoded delta on RideConstruction

* Use named Direction constants

* Make Compat::map_get_first_element_at() use CoordsXY
2019-12-23 07:35:41 +00:00
Matt 52ee9c6896
Use enum class for ExpenditureType 2019-12-22 20:51:55 +01:00
Tulio Leao 72b4d93ad2 Avoid dereferencing map_get_surface_element_at nullptr on libopenrct2 2019-11-18 08:01:04 -03:00
Tulio Leao 35577f5b19 Avoid dereferencing invalid map_get_first_element_at return 2019-10-19 07:54:31 -03:00
Richard Fine 31ce0f20f7 Use range-based for loops for checking all directions 2019-09-01 18:40:28 +01:00
duncanspumpkin c6452095ca Refactor tile_element_height to use CoordsXY 2019-08-19 20:04:57 +01:00
duncanspumpkin 5333dc4295 Return a SurfaceElement from get_surface_element 2019-08-19 20:04:56 +01:00
Ted John 9954f0b725
Add nullptr checks for more instances of get_ride (#9819) 2019-08-09 14:20:59 +01:00
Ted John ab7b17fc4e
Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Nicole d38fb6a7a2 Fix #8800: ensure tile_element_height is used correctly (#9087)
* Changed calls to tile_element_height to tile_element_water_height

* Changes to calls to tile_element_height

* Removed tile element_height, map_get_highest_land_height, and map_get lowest_land_height

3 functions removed due to relocation.

* Added function tile_element_height back to map.cpp

Added tile_element height back to map.cpp. Was unnecessarily deleted.

* Update Map.h

* water_height changes

* Update Scenario.cpp

* Update Scenario.cpp

* Fix 8800: applied clang format

* Removed unnecessary ANDs
2019-04-23 18:26:48 +01:00
Michael Steenbeek 5a906b2378
Port more functions to Ride struct (#9119) 2019-04-20 22:22:39 +02:00
Michael Steenbeek 68aa5122fa
Fix #6006: Objects higher than 6 metres are considered trees 2019-03-18 22:56:14 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin 904bb0b6e9 Fix formatting 2019-03-09 18:07:52 +00:00
duncanspumpkin 63e7f7a990 Use correct error messages with can_construct_with_clear
Pass correct parameters to the function
2019-03-09 18:07:52 +00:00
duncanspumpkin 6890f4f756 Use quarter tile for map can construct at
Make callees of map_can_construct_with_clear use QuarterTile

Use quarter tile for small scenery rotation

Fix clang format

Further clang format
2019-02-25 13:51:08 +00:00
Matt 92d73e2fab Set last player position based on game action result. 2019-02-21 15:51:00 +01:00
Matt a6c6d6ddc3 Update checks for when money is required. 2019-02-18 17:19:44 +01:00
Michael Steenbeek 76603ad1b3
Fix #8696: Setting land height costs money in no-money scenarios 2019-02-10 22:14:23 +01:00
duncanspumpkin 44cd8c3150 Refactor. Add CoordsXY to data serialiser 2019-02-08 14:08:26 +00:00
duncanspumpkin ea585950f6 Refactor. Split out into multiple functions. 2019-02-08 14:08:26 +00:00
duncanspumpkin fd7f9fefca Move Land Set Height over to GameAction Framework 2019-02-08 14:08:26 +00:00