Devilution
Diablo devolved - magic behind the 1996 computer game

◆ path_check_equal()

int path_check_equal ( PATHNODE pPath,
int  dx,
int  dy 
)

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

Definition at line 117 of file path.cpp.