MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / IsPositionInPath

Method IsPositionInPath

Source/player.cpp:1754–1769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1752}
1753
1754bool 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
1771void Player::Say(HeroSpeech speechId) const
1772{

Callers 2

DrawCellFunction · 0.80
DrawFloorFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected