ramp tops inherit walkability group of the tile below
| 479 | |
| 480 | // ramp tops inherit walkability group of the tile below |
| 481 | static uint16_t get_walk_group(const df::coord & pos) { |
| 482 | df::tile_designation *des = Maps::getTileDesignation(pos); |
| 483 | if (!des || des->bits.hidden) |
| 484 | return 0; |
| 485 | uint16_t walk = Maps::getWalkableGroup(pos); |
| 486 | if (walk) |
| 487 | return walk; |
| 488 | if (auto tt = Maps::getTileType(pos)) { |
| 489 | if (tileShape(*tt) == df::tiletype_shape::RAMP_TOP) { |
| 490 | df::coord pos_below(pos); |
| 491 | --pos_below.z; |
| 492 | walk = Maps::getWalkableGroup(pos_below); |
| 493 | } |
| 494 | } |
| 495 | return walk; |
| 496 | } |
| 497 | |
| 498 | static bool is_tree(const df::tiletype *tt) { |
| 499 | return tileMaterial(*tt) == tiletype_material::TREE; |
no test coverage detected