This function is duplicated in pathfinding.cpp. Maybe it would be good to put declaration of it in pathfinding.hpp file, and remove definition from here (pathfinding.hpp is included in aitravel.hpp)? What do you think? Also by default all floating point values without "f" suffix are double type.