MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getWallElement

Function getWallElement

src/OpenLoco/src/Map/SurfaceElement.cpp:70–99  ·  view source on GitHub ↗

0x004C49E9

Source from the content-addressed store, hash-verified

68
69 // 0x004C49E9
70 static WallElement* getWallElement(const World::Pos2 loc, SmallZ baseZ, SmallZ clearZ, uint8_t direction)
71 {
72 auto tile = TileManager::get(loc);
73 for (auto& el : tile)
74 {
75 auto* elWall = el.as<WallElement>();
76 if (elWall == nullptr)
77 {
78 continue;
79 }
80 if (elWall->isGhost())
81 {
82 continue;
83 }
84 if (elWall->clearZ() < baseZ)
85 {
86 continue;
87 }
88 if (elWall->baseZ() > clearZ)
89 {
90 continue;
91 }
92 if (elWall->rotation() != direction)
93 {
94 continue;
95 }
96 return elWall;
97 }
98 return nullptr;
99 }
100
101 static bool updateIndustrialSurface(SurfaceElement& elSurface, const World::Pos2 loc)
102 {

Callers 1

updateIndustrialSurfaceFunction · 0.85

Calls 5

clearZMethod · 0.80
baseZMethod · 0.80
getFunction · 0.70
isGhostMethod · 0.45
rotationMethod · 0.45

Tested by

no test coverage detected