ERR_NO_PATH not returning properly



  • According to the documentation, ERR_NO_PATH should be returned if a path cannot be found to the target of a moveTo command. However, in simulation testing, I found that a creep that has no route to the target due to walls will not return that error unless every single direction around it is blocked. If it has a free position it can move to, it will return a success, resulting in the creep zig-zagging between two tiles. This results in extreme difficulty in programming creeps to attack walls, as the creep will not report that it has no path (due to walls in the way) and will zig-zag between 2 tiles in the target room. If this is intended behavior, please clarify the documentation to indicate ERR_NO_PATH only returns if the creep cannot move in any direction.

    🧐


  • I don't think it is intended, but it could be a distance problem.
    The creep always tries to get to the closest tile if both have the same distance it could result is this Pathfinder loop...