| 30 | } |
| 31 | |
| 32 | static void updateNonIndustrialSurface(SurfaceElement& elSurface, const World::Pos2 loc) |
| 33 | { |
| 34 | auto* landObj = ObjectManager::get<LandObject>(elSurface.terrain()); |
| 35 | if (!landObj->hasFlags(LandObjectFlags::hasGrowthStages)) |
| 36 | { |
| 37 | return; |
| 38 | } |
| 39 | elSurface.setUpdateTimer(elSurface.getUpdateTimer() + 1); |
| 40 | if (elSurface.getUpdateTimer() != 0) |
| 41 | { |
| 42 | return; |
| 43 | } |
| 44 | if (elSurface.water()) |
| 45 | { |
| 46 | SmallZ waterZ = elSurface.water() * kMicroToSmallZStep; |
| 47 | if (elSurface.slope()) |
| 48 | { |
| 49 | waterZ -= 4; |
| 50 | } |
| 51 | if (waterZ > elSurface.baseZ()) |
| 52 | { |
| 53 | if (elSurface.getGrowthStage()) |
| 54 | { |
| 55 | elSurface.setGrowthStage(0); |
| 56 | Ui::ViewportManager::invalidate(loc, elSurface.baseHeight(), elSurface.baseHeight()); |
| 57 | } |
| 58 | return; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | if (elSurface.getGrowthStage() + 1 < landObj->numGrowthStages) |
| 63 | { |
| 64 | elSurface.setGrowthStage(elSurface.getGrowthStage() + 1); |
| 65 | Ui::ViewportManager::invalidate(loc, elSurface.baseHeight(), elSurface.baseHeight()); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // 0x004C49E9 |
| 70 | static WallElement* getWallElement(const World::Pos2 loc, SmallZ baseZ, SmallZ clearZ, uint8_t direction) |
no test coverage detected