0x00469D76
| 22 | { |
| 23 | // 0x00469D76 |
| 24 | static uint32_t clearTile(World::Pos2 pos, World::TileClearance::RemovedBuildings& removedBuildings, const uint8_t flags) |
| 25 | { |
| 26 | // This shouldn't happen due to using TilePosRangeView |
| 27 | if (!World::validCoords(pos)) |
| 28 | { |
| 29 | GameCommands::setErrorText(StringIds::off_edge_of_map); |
| 30 | return GameCommands::kFailure; |
| 31 | } |
| 32 | |
| 33 | if (flags & GameCommands::Flags::apply) |
| 34 | { |
| 35 | if (!SceneManager::isEditorMode()) |
| 36 | { |
| 37 | TileManager::setTerrainStyleAsCleared(pos); |
| 38 | } |
| 39 | |
| 40 | auto tileHeight = World::TileManager::getHeight(pos); |
| 41 | TileManager::removeAllWallsOnTileAbove(World::toTileSpace(pos), tileHeight.landHeight / 4); |
| 42 | } |
| 43 | |
| 44 | World::QuarterTile qt(0xF, 0); |
| 45 | |
| 46 | currency32_t cost{}; |
| 47 | // Bind our local vars to the tile clear function |
| 48 | auto clearFunc = [pos, &removedBuildings, flags, &cost](World::TileElement& el) { |
| 49 | return TileClearance::clearWithoutDefaultCollision(el, pos, removedBuildings, flags, cost); |
| 50 | }; |
| 51 | |
| 52 | auto tileHeight = World::TileManager::getHeight(pos); |
| 53 | if (TileClearance::applyClearAtAllHeights(pos, tileHeight.landHeight / 4, tileHeight.landHeight / 4, qt, clearFunc)) |
| 54 | { |
| 55 | return cost; |
| 56 | } |
| 57 | else |
| 58 | { |
| 59 | return GameCommands::kFailure; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // 0x00469CCB |
| 64 | static uint32_t clearLand(const ClearLandArgs& args, const uint8_t flags) |
no test coverage detected