1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00
Commit Graph

188 Commits

Author SHA1 Message Date
Tulio Leao
35577f5b19 Avoid dereferencing invalid map_get_first_element_at return 2019-10-19 07:54:31 -03:00
Denis Khabenkov
4e111c66a3 Fix #10074: Refactor TrackDesignEntranceElement 2019-10-11 00:25:13 +03:00
Denis Khabenkov
57a208d560 Fix #10064: Refactor TrackDesignEntranceElement (#10066)
* Fix #10064: Refactor TrackDesignEntranceElement
2019-10-10 18:23:29 +01:00
Tulio Leao
b793d7e79a Avoid dereferencing map_get_first_element_at nullptr on libopenrct2 (#10013)
* Avoid dereferencing map_get_first_element_at nullptr on Map.cpp

* Avoid dereferencing map_get_first_element_at nullptr on MapAnimation.cpp

Returning true or internal control variable, based on what was seen on `map_animation_invalidate_track_onridephoto`

* Avoid dereferencing map_get_first_element_at nullptr on Park.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Scenery.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Sprite.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TileInspector.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Wall.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Fountain.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Footpath.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Entrance.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Banner.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Vehicle.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesignSave.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesign.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Track.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Station.cpp

* Avoid dereferencing map_get_first_element_at nullptr on RideRatings.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Ride.cpp

* Avoid dereferencing map_get_first_element_at nullptr on S4Importer.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Staff.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Peep.cpp

* Avoid dereferencing map_get_first_element_at nullptr on GuestPathfinding.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Guest.cpp

* Avoid dereferencing map_get_first_element_at nullptr on VirtualFloor.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Paint.TileElement.cpp

* Fix issues raised on review

* Fix remaining review issues.

* Early exit on loops if tileElement is nullptr

* Fix clang-format issues
2019-10-09 15:02:21 +01:00
Tulio Leao
7193ba1bb7 Create TrackDesignMazElement struct
Closes #10053
2019-10-08 18:21:58 -03:00
Tulio Leao
6be7c42a3d Close #10051: Create TrackDesignSceneryElement 2019-10-08 17:13:34 +02:00
Tulio Leao
ff57f43996 Create TrackDesignTrackElement struct
Closes #10054
2019-10-08 07:47:56 -03:00
Denis Khabenkov
de53ac84b8 Fix #10052: Create a TrackDesignEntranceElement struct to replace rct_td6_entrance_element 2019-10-07 21:59:07 +03:00
Gymnasiast
bb73dd0dfb Refactor track element to use 16 bytes 2019-08-31 13:14:19 +02:00
Gymnasiast
f365bc3cb7 Create getters and setters for occupied quadrant 2019-08-27 21:12:48 +02:00
Gymnasiast
ec5ba20992 Create dedicated method for SetLastForTile() 2019-08-25 16:13:02 +02:00
Gymnasiast
6e200459d3 Refactor some accessors to tile element type and flags fields 2019-08-24 22:42:47 +02:00
duncanspumpkin
927c8a4e85 Create ScreenCoords struct. Refactor 3d_to_2d again 2019-08-19 20:04:58 +01:00
duncanspumpkin
fb8c42f3c2 Fix #9557. Refactor map_is_location_at_edge and tile_element_insert 2019-08-19 20:04:57 +01:00
duncanspumpkin
5b92b64ec7 Refactor map_get_path_element_at to return PathElement and use CoordsXYZ 2019-08-19 20:04:57 +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
duncanspumpkin
9619fd384d Refactor map_is_location_owned to use CoordsXYZ 2019-08-19 20:04:56 +01:00
duncanspumpkin
486f13440f Fix #9875. Check for valid tile element before dereferencing 2019-08-17 11:06:19 +01:00
duncanspumpkin
5a611f49d6 Fix #9859. Actually keep the loading of a track design with try.
Mistake whilst implementing track desing importer and changing where code that could throw.
2019-08-15 20:13:39 +01:00
duncanspumpkin
2e24dc1f00 Fix large scenery mirror rotation 2019-08-09 20:43:03 +01:00
duncanspumpkin
af31404472 Use std::string and cleanup unused functions
Use CoordsXY for save pop scenery functions

Use CoordsXY for push save scenery functions

Further refactoring to use coordsxy and standard functions
2019-08-09 20:43:03 +01:00
duncanspumpkin
e9b59064e0 Fix code and clang format. Delete dead code.
Use correct TD4 checksum for vanilla TD4's.

Simplified the code for version detection since checksum numbers do not match up to a version

Fix TD4 imports.

Oh yeah TD4 doesn't have scenery or entrances

Move track related structs to correct files
2019-08-09 20:43:02 +01:00
duncanspumpkin
54d6722bf2 Link everything together 2019-08-09 20:40:35 +01:00
duncanspumpkin
16022a8b57 Remove dead code 2019-08-09 20:39:54 +01:00
duncanspumpkin
e3c63b762e Create new TrackDesign format 2019-08-09 20:39:53 +01:00
Ted John
ab7b17fc4e Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Ted John
746d784b0e Fix placing track designs when ride 0 is not allocated 2019-08-07 21:25:28 +01:00
Ted John
cd4eb86a7c Merge pull request #9725 from IntelOrca/refactor/ride-manager
Refactor ride list
2019-08-07 21:03:17 +01:00
0cufox0
b4e0df2e5f Fix review issues and formatting 2019-08-05 20:19:57 +01:00
0cufox0
8e33619b63 Refactor LargeSceneryRemoveAction 2019-08-05 20:18:01 +01:00
0cufox0
5cd8541a1c Refactor smalSceneryRemoveAction 2019-08-05 20:17:57 +01:00
0cufox0
0320f195e3 refactor wallRemoveAction 2019-08-05 19:52:47 +01:00
Ted John
e23638548a Reduce use of MAX_RIDES and RIDE_TYPE_NULL 2019-08-04 16:44:17 +01:00
Ted John
3f8890afde Fix remaining errors and a few bugs 2019-07-29 19:18:16 +01:00
Michael Steenbeek
aff3e42408 Merge pull request #9453 from duncanspumpkin/remove_gc
Remove Networked Game Commands
2019-07-14 14:46:46 +02:00
Aaron van Geffen
cfd863ef12 Prevent making unnecessary copies in certain tile loops (#9549) 2019-07-11 18:43:33 +02:00
Gymnasiast
063b87e0a0 Remove more unused code; fix compilation on GCC 2019-06-23 23:10:34 +02:00
duncanspumpkin
2d75c01882 Unnetwork game commands
Only track designs still use game commands and they cannot be networked so remove dead code
2019-06-23 18:50:35 +01:00
Ted John
6f0298deb3 Refactor ride measurement storage 2019-06-09 11:55:41 +02:00
aw20368
e0cf476398 Fix #8723 Use rotate_map_coordinates to rotate coordinate
Added Rotate to CoordsXY, TileCoordsXY and used them to replace redundant rotation code.
2019-06-06 08:21:40 -04:00
Ted John
f842d8a693 Fix #5103: OpenGL: ride track preview not rendered 2019-05-02 00:07:43 +00: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
duncanspumpkin
baad532c17 Fix formatting 2019-04-07 14:55:08 +01:00
duncanspumpkin
d63919c0cc Implement LargeSceneryPlaceAction 2019-04-07 14:55:07 +01:00
duncanspumpkin
63f9e3dbb4 Set tertiary colour correctly 2019-04-06 18:56:44 +01:00
duncanspumpkin
3e9356857f Fix wall placement in track designs.
X and Y values go a bit screwey in ride previews. So you need to override there check.
Also fixed the wall from nesting the command wrong
2019-04-06 18:06:40 +01:00
duncanspumpkin
cee953f899 Fix #9042. Pass the flags to wall placement when in track design mode 2019-04-04 19:23:44 +01:00
duncanspumpkin
eedb24700d Fix #8535, #8480. Unintialised variable used to get path object.
When you try to mirror a track design that has a path object type that isn't loaded it will try to pass an uninitialised variable as the index of the path object. This will cause a bad pointer to be generated. Fix was to auto set it to zero and to be super careful reset it again to zero in the case when its not available
2019-04-04 19:23:44 +01:00
duncanspumpkin
5280728760 Fix formatting 2019-04-04 19:23:44 +01:00