MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / MapHeightFromSlope

Function MapHeightFromSlope

src/openrct2/world/Map.cpp:785–802  ·  view source on GitHub ↗

* * rct2: 0x006A7B84 */

Source from the content-addressed store, hash-verified

783 * rct2: 0x006A7B84
784 */
785 int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped)
786 {
787 if (!isSloped)
788 return 0;
789
790 switch (slopeDirection % kNumOrthogonalDirections)
791 {
792 case TILE_ELEMENT_DIRECTION_WEST:
793 return (31 - (coords.x & 31)) / 2;
794 case TILE_ELEMENT_DIRECTION_NORTH:
795 return (coords.y & 31) / 2;
796 case TILE_ELEMENT_DIRECTION_EAST:
797 return (coords.x & 31) / 2;
798 case TILE_ELEMENT_DIRECTION_SOUTH:
799 return (31 - (coords.y & 31)) / 2;
800 }
801 return 0;
802 }
803
804 bool MapIsLocationValid(const CoordsXY& coords)
805 {

Callers 3

UpdateFallingMethod · 0.85
GetZOnSlopeMethod · 0.85
updateRideLeaveExitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected