|
@@ -390,7 +390,7 @@ namespace CommonAI.Zone.Instance
|
|
|
float x = dstx + dx * W * vx;
|
|
|
if (MathVector.getDistanceSquare(x, yy, dstx, dsty) < squCircle)
|
|
|
{
|
|
|
- if (!path_finder.TouchMapBlock(((int)x) / W, ((int)yy) / H))
|
|
|
+ if (!path_finder.TouchMapBlock(((int)x) / W, ((int)yy) / H) && findPath(sx, sy, x, yy) != null)
|
|
|
{
|
|
|
outx = x;
|
|
|
outy = yy;
|
|
@@ -404,7 +404,7 @@ namespace CommonAI.Zone.Instance
|
|
|
float y = dsty + dy * H * vy;
|
|
|
if (MathVector.getDistanceSquare(xx, y, dstx, dsty) < squCircle)
|
|
|
{
|
|
|
- if (!path_finder.TouchMapBlock(((int)xx) / W, ((int)y) / H))
|
|
|
+ if (!path_finder.TouchMapBlock(((int)xx) / W, ((int)y) / H) && findPath(sx, sy, xx, y) != null)
|
|
|
{
|
|
|
outx = xx;
|
|
|
outy = y;
|