0x00477FC2
| 28 | |
| 29 | // 0x00477FC2 |
| 30 | bool RoadElement::update(const World::Pos2& loc) |
| 31 | { |
| 32 | if (owner() == CompanyId::neutral || CompanyManager::isPlayerCompany(owner())) |
| 33 | { |
| 34 | return true; |
| 35 | } |
| 36 | |
| 37 | if (!(getGameState().roadObjectIdIsAnyRoadTypeCompatible & (1 << roadObjectId()))) |
| 38 | { |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | if (sequenceIndex()) |
| 43 | { |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | if (hasUnk7_10() || hasLevelCrossing() || hasUnk7_40() || hasUnk7_80()) |
| 48 | { |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | if (isGhost() || isAiAllocated()) |
| 53 | { |
| 54 | return true; |
| 55 | } |
| 56 | |
| 57 | if (hasStationElement()) |
| 58 | { |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | // Verify there are no other conflicting tile elements on the current tile either. |
| 63 | // This probably duplicates the above series of checks as well? |
| 64 | auto tile = TileManager::get(loc); |
| 65 | for (auto& el : tile) |
| 66 | { |
| 67 | auto* roadEl = el.as<RoadElement>(); |
| 68 | if (roadEl == nullptr) |
| 69 | { |
| 70 | continue; |
| 71 | } |
| 72 | |
| 73 | if (roadEl->baseZ() != baseZ()) |
| 74 | { |
| 75 | continue; |
| 76 | } |
| 77 | |
| 78 | if (roadEl->owner() == CompanyId::neutral || CompanyManager::isPlayerCompany(roadEl->owner())) |
| 79 | { |
| 80 | continue; |
| 81 | } |
| 82 | |
| 83 | if (!(getGameState().roadObjectIdIsAnyRoadTypeCompatible & (1 << roadEl->roadObjectId()))) |
| 84 | { |
| 85 | continue; |
| 86 | } |
| 87 |
no test coverage detected