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

Method GetZOnSlope

src/openrct2/entity/Peep.cpp:2499–2511  ·  view source on GitHub ↗

* Gets the height including the bit depending on how far up the slope the peep * is. * rct2: 0x00694921 */

Source from the content-addressed store, hash-verified

2497 * rct2: 0x00694921
2498 */
2499 int32_t Peep::GetZOnSlope(int32_t tile_x, int32_t tile_y)
2500 {
2501 if (tile_x == kLocationNull)
2502 return 0;
2503
2504 if (GetNextIsSurface())
2505 {
2506 return TileElementHeight({ tile_x, tile_y });
2507 }
2508
2509 uint8_t slope = GetNextDirection();
2510 return NextLoc.z + MapHeightFromSlope({ tile_x, tile_y }, slope, GetNextIsSloped());
2511 }
2512
2513 StringId GetRealNameStringIDFromPeepID(uint32_t id)
2514 {

Callers 1

PeepFootpathMoveForwardFunction · 0.80

Calls 3

TileElementHeightFunction · 0.85
GetNextDirectionFunction · 0.85
MapHeightFromSlopeFunction · 0.85

Tested by

no test coverage detected