Skip to content

Commit

Permalink
telepath finding tweak, fixes paths that need to backtrack.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobode committed Jan 17, 2014
1 parent 106e3a7 commit fb0f835
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion D2BS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <windows.h>
#include <vector>
Expand Down
14 changes: 8 additions & 6 deletions Map/Path/Reduction/TeleportPathReducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -82,27 +83,28 @@ 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--)
{
for(int j = 1; j >= -1; j--)
{
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)
{
Expand Down

0 comments on commit fb0f835

Please sign in to comment.