| 12 | namespace OpenLoco::GameCommands |
| 13 | { |
| 14 | static World::TrackElement* getElTrackAt(const SignalRemovalArgs& args, const World::Pos3 pos, const uint8_t sequenceIndex) |
| 15 | { |
| 16 | auto tile = World::TileManager::get(pos); |
| 17 | for (auto& el : tile) |
| 18 | { |
| 19 | auto* elTrack = el.as<World::TrackElement>(); |
| 20 | if (elTrack == nullptr) |
| 21 | { |
| 22 | continue; |
| 23 | } |
| 24 | if (elTrack->baseHeight() != pos.z) |
| 25 | { |
| 26 | continue; |
| 27 | } |
| 28 | if (elTrack->rotation() != args.rotation) |
| 29 | { |
| 30 | continue; |
| 31 | } |
| 32 | if (elTrack->sequenceIndex() != sequenceIndex) |
| 33 | { |
| 34 | continue; |
| 35 | } |
| 36 | if (elTrack->trackObjectId() != args.trackObjType) |
| 37 | { |
| 38 | continue; |
| 39 | } |
| 40 | if (elTrack->trackId() != args.trackId) |
| 41 | { |
| 42 | continue; |
| 43 | } |
| 44 | return elTrack; |
| 45 | } |
| 46 | return nullptr; |
| 47 | }; |
| 48 | |
| 49 | static currency32_t signalRemoveCost(const SignalRemovalArgs& args, const World::TrackData::PreviewTrack trackPiece0, const World::Pos3 trackStart) |
| 50 | { |
no test coverage detected