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

Function CheckEqual

Source/engine/path.cpp:169–175  ·  view source on GitHub ↗

* @brief return 2 if pPath is horizontally/vertically aligned with (dx,dy), else 3 * * This approximates that diagonal movement on a square grid should have a cost * of sqrt(2). That's approximately 1.5, so they multiply all step costs by 2, * except diagonal steps which are times 3 */

Source from the content-addressed store, hash-verified

167 * except diagonal steps which are times 3
168 */
169int CheckEqual(Point startPosition, Point destinationPosition)
170{
171 if (startPosition.x == destinationPosition.x || startPosition.y == destinationPosition.y)
172 return 2;
173
174 return 3;
175}
176
177/**
178 * @brief update all path costs using depth-first search starting at pPath

Callers 2

SetCoordsFunction · 0.85
ParentPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected