| 1752 | } |
| 1753 | |
| 1754 | bool Player::IsPositionInPath(Point pos) |
| 1755 | { |
| 1756 | constexpr Displacement DirectionOffset[8] = { { 0, -1 }, { -1, 0 }, { 1, 0 }, { 0, 1 }, { -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 } }; |
| 1757 | Point target = position.future; |
| 1758 | for (auto step : walkpath) { |
| 1759 | if (target == pos) { |
| 1760 | return true; |
| 1761 | } |
| 1762 | if (step == WALK_NONE) |
| 1763 | break; |
| 1764 | if (step > 0) { |
| 1765 | target += DirectionOffset[step - 1]; |
| 1766 | } |
| 1767 | } |
| 1768 | return false; |
| 1769 | } |
| 1770 | |
| 1771 | void Player::Say(HeroSpeech speechId) const |
| 1772 | { |