* Can one drive at the specified tile? * @param x X coordinate at map. * @param y Y coordinate at map. * @return 0 if not, 1 if you can, -1 otherwise */
| 1619 | * @return 0 if not, 1 if you can, -1 otherwise |
| 1620 | */ |
| 1621 | int Micropolis::canDriveOn(int x, int y) |
| 1622 | { |
| 1623 | int tile; |
| 1624 | |
| 1625 | if (!testBounds(x, y)) { |
| 1626 | return 0; |
| 1627 | } |
| 1628 | |
| 1629 | tile = map[x][y] & LOMASK; |
| 1630 | |
| 1631 | if ((tile >= ROADBASE && tile <= LASTROAD && tile != BRWH && tile != BRWV) |
| 1632 | || tile == HRAILROAD || tile == VRAILROAD) { |
| 1633 | return 1; |
| 1634 | } |
| 1635 | |
| 1636 | if (tile == DIRT || tally(tile)) { |
| 1637 | return -1; |
| 1638 | } |
| 1639 | |
| 1640 | return 0; |
| 1641 | } |
| 1642 | |
| 1643 | |
| 1644 | /** |
nothing calls this directly
no test coverage detected