1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00
Commit Graph

281 Commits

Author SHA1 Message Date
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
Sohil Adwani
03f016e9ef Smart pointers (#11852)
* Part of #11159 Added smart pointers to a few functions

* Use camelCase for variables

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-06-15 19:47:07 +01:00
Michael Steenbeek
1ea1d24f00 Use constant for 255 tile element height (#11928) 2020-06-10 23:18:26 +02:00
Gymnasiast
09cc95f536 Move remaining calls to set_format_arg() 2020-06-03 14:49:04 +02:00
Hummel95
aac55d2cc0 Fix #10876: Peeps spawns can stack and are not removable (#11155) 2020-05-09 16:17:08 +02:00
Michael Steenbeek
f3c0476673 Create constants for both tile element limits (#11645) 2020-05-05 15:40:33 +02: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
Ted John
32d72471b8 Add more tile APIs 2020-04-26 14:35:04 +01:00
Michał Janiszewski
2323cc1596 Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Michał Janiszewski
c4b6897635 Address possible nullptr dereferences 2020-04-21 13:31:01 +02:00
Michael Steenbeek
8127437de1 Reduce direct ride type checking; move available piece lookup to RTD (#11353) 2020-04-19 13:32:43 +02:00
Olivier Wervers
b71062ce1b Fix #6530: Make land tools work consistently on park borders (#11181)
Makes all land tools behave the same
2020-04-18 08:19:03 -03:00
Tulio Leao
64e4a8420e Use named casts on openrct2/world (#11141) 2020-04-17 21:08:22 +02:00
Gymnasiast
5dc4b3e136 Make tile_element_insert take CoordsXYZ 2020-03-07 21:28:36 +01:00
Michael Steenbeek
be13c1fc87 Refactor more TileCoords 2020-03-07 21:07:18 +01:00
Gymnasiast
3ed7694495 Move tile element-specific flags 2020-03-04 22:01:09 +01:00
Gymnasiast
57a40c0657 Extend PathElement 2020-03-04 21:57:42 +01:00
Matt
758a7e432f Use const reference instead of copy for location structures 2020-02-13 11:53:14 +01:00
Michael Steenbeek
d16fbb0cd2 Change ride->overall_view to CoordsXY (#10673) 2020-02-08 17:19:59 +01:00
Michael Steenbeek
5da4903430 Fix #10629: Footpaths on the ground do not cost money (#10671) 2020-02-08 16:29:14 +01:00
Ted John
1e6bf84796 Do not log element out of range as error (#10641)
Many routines will attempt to access tile elements outside the range of the map. This can happen for example when a routine is observing surrounding tiles of a piece of track that is near the edge of the map. Null is returned from the function which is handled by the routine, so not really an error and can reduce many bounds checking in callers.
2020-02-01 20:44:57 +00:00
Tulio Leao
b7e9b36a27 Prefer std::array and COORDS defines on Map::CoordsDirectionDelta 2020-01-19 13:30:29 -03: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
8abb9e5515 Fix obstructions not stopping ride placement (#10585) 2020-01-19 15:12:26 +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
Tulio Leao
ac063a7e9a Use CoordsXY on footpath_update_path_wide_flags() 2020-01-14 07:33:43 -03: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
7cf03d3e41 Use CoordsXY on footpath_remove_edges_at() 2020-01-11 11:13:04 -03:00
Michael Steenbeek
08ab15ef36 Fix #10313: Path furniture can be placed on level crossings 2020-01-05 17:59:02 +01:00
Michael Steenbeek
63da894257 Merge pull request #10511 from tupaschoal/improve-clear-at
Improve variable names in map_can_construct_with_clear_at() and use big Z
2020-01-04 19:57:46 +01:00
Tulio Leao
d3579e472b Use Big Z coordinates for map_can_construct_with_clear_at() vars 2020-01-04 10:31:18 -03:00
Tulio Leao
dff747ce0f Improve variable names in map_can_construct_with_clear_at() 2020-01-04 10:27:57 -03:00
Tulio Leao
d861658669 Use CoordsXY on Scenery and SmallScenery (#10513) 2020-01-04 12:45:51 +01:00
Tulio Leao
06fb16ee88 Use CoordsXYZ for gMapSelectArrowPosition (#10442) 2019-12-30 16:51:35 +00:00
Michael Steenbeek
77494bbc73 Create definitions for some coords related stuff (#10456)
* Create definitions for some coords related stuff

* Use constexpr; add define for Z step
2019-12-30 15:03:51 +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
Michael Steenbeek
8ca0cf52a7 Replace more direct accesses to base/clearance Z with getter/setter (#10454) 2019-12-27 15:26:40 +01:00
Tulio Leao
9ec25e85cb Coords for map_get_tile* (#10440)
* Make Map::map_get_tile_side() use CoordsXY
* Make Map::map_get_tile_quadrant() use CoordsXY
2019-12-27 12:36:47 +01:00
Tulio Leao
e827509786 Make Map::sign_set_colour() use CoordsXYZD (#10441)
* Make Map::sign_set_colour() use CoordsXYZD

* Rename Map::sign_set_colour()
2019-12-26 15:18:51 +00:00
Michael Steenbeek
b8687511a4 Merge pull request #10436 from tupaschoal/coords-large-scenery
Make Map's large scenery functions use Coords objects
2019-12-24 15:51:20 +01:00
Tulio Leao
81647b3dd8 Make Map::map_get_track_element_at_with_direction_from_ride() use CoordsXYZD 2019-12-24 11:19:06 -03:00
Tulio Leao
6ab46bd74a Make Map::map_get_track_element_at_from_ride() use CoordsXYZ 2019-12-24 11:19:06 -03:00
Tulio Leao
c718d2be42 Make Map::map_get_track_element_at_of_type_from_ride() use CoordsXYZ 2019-12-24 11:19:06 -03:00
Tulio Leao
21435a4d01 Make Map::map_get_track_element_at_of_type_seq() use CoordsXYZ 2019-12-24 11:19:05 -03:00
Tulio Leao
77503fee97 Make Map::map_get_track_element_at_of_type() use CoordsXYZ 2019-12-24 11:19:05 -03:00
Tulio Leao
6c998d7b4d Make Map::map_get_track_element_at() use CoordsXYZ 2019-12-24 11:19:03 -03:00
Gymnasiast
62fcbb07ca Rename methods to GetBaseZ/GetClearanceZ 2019-12-23 20:08:37 +01:00