| 219 | }; |
| 220 | |
| 221 | static bool is_wagon_dynamic_traversible(df::tiletype_shape shape, const df::coord & pos) { |
| 222 | auto bld = Buildings::findAtTile(pos); |
| 223 | if (!bld) return false; |
| 224 | |
| 225 | auto btype = bld->getType(); |
| 226 | // open hatch should be inaccessible regardless of the tile it sits on |
| 227 | if (btype == df::building_type::Hatch) { |
| 228 | if (shape == df::tiletype_shape::RAMP_TOP) |
| 229 | return false; |
| 230 | |
| 231 | auto& hatch = *static_cast<df::building_hatchst*>(bld); |
| 232 | if (hatch.door_flags.bits.closed) |
| 233 | return true; |
| 234 | // open floor grate/bar should be inaccessible regardless of the tile it sits on |
| 235 | } else if (btype == df::building_type::GrateFloor) { |
| 236 | auto& b = *static_cast<df::building_grate_floorst*>(bld); |
| 237 | if (b.gate_flags.bits.closed) |
| 238 | return true; |
| 239 | } else if (btype == df::building_type::BarsFloor) { |
| 240 | auto& b = *static_cast<df::building_bars_floorst*>(bld); |
| 241 | if (b.gate_flags.bits.closed) |
| 242 | return true; |
| 243 | } |
| 244 | // Doors, traps..etc |
| 245 | return false; |
| 246 | } |
| 247 | |
| 248 | // NOTE: When i.e. tracks, stairs have a bridge over them, the tile will have |
| 249 | // an occupancy of floored. |
no test coverage detected