From fb0f835896bb3621bab9d0256c0eed027f45d325 Mon Sep 17 00:00:00 2001 From: bobode Date: Fri, 17 Jan 2014 23:16:17 +0000 Subject: [PATCH] telepath finding tweak, fixes paths that need to backtrack. --- D2BS.h | 2 +- Map/Path/Reduction/TeleportPathReducer.h | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/D2BS.h b/D2BS.h index a7482cdb..3f0a2695 100644 --- a/D2BS.h +++ b/D2BS.h @@ -5,7 +5,7 @@ #define XP_WIN -#define D2BS_VERSION "1.5.1821" //uptodate with d branch 1765 ff 20b +#define D2BS_VERSION "1.5.1822" //uptodate with d branch 1765 ff 20b #include #include diff --git a/Map/Path/Reduction/TeleportPathReducer.h b/Map/Path/Reduction/TeleportPathReducer.h index 77ff498a..559b129b 100644 --- a/Map/Path/Reduction/TeleportPathReducer.h +++ b/Map/Path/Reduction/TeleportPathReducer.h @@ -58,18 +58,19 @@ class TeleportPathReducer : public PathReducer return; } // find best tele spot, this dosent help in arcane sant + Point best(0,0); bool needExraExpand = false; int val=1000000; int r = range / 10; - r = r-2; + int x,y; for(int x = center.first - r; x <= center.first + r; x ++) { for(int y = center.second - r; y <= center.second + r; y++) { - if( Euclidean(Point(x, y),center) < range && Euclidean(Point(x, y),center) > range-20 ) + if( Euclidean(Point(x, y),center) < range && Euclidean(Point(x, y),center) > range-5 ) { if(!Reject(Point(x, y),true)) { @@ -82,12 +83,13 @@ class TeleportPathReducer : public PathReducer } } } - if (best.first != 0 && map->PathingPointList.find(best) == map->PathingPointList.end() && Euclidean(best, endpoint) < Euclidean(center, endpoint)) + if (best.first != 0 && map->PathingPointList.find(best) == map->PathingPointList.end() && Euclidean(best, endpoint) < Euclidean(center, endpoint)) { map->PathingPointList.insert(best); out.push_back(best); return; } + //expand point normally if smart tele isnt found for(int i = 1; i >= -1; i--) { @@ -95,14 +97,14 @@ class TeleportPathReducer : public PathReducer { if( i == 0 && j == 0 || Reject(Point(center.first+i, center.second+j), true)) continue; - if(map->PathingPointList.find(Point(center.first+i, center.second+j)) != map->PathingPointList.end()) - continue; + //if(map->PathingPointList.find(Point(center.first+i, center.second+j)) != map->PathingPointList.end()) + //continue; out.push_back(Point(center.first+i, center.second+j)); map->PathingPointList.insert(Point(center.first+i, center.second+j)); } } - if(map->GetLevel()->dwLevelNo != 74) + //if(map->GetLevel()->dwLevelNo != 74) return; for(int i = range/10; i >= range/10*-1; i =i-4) {