mirror of
https://github.com/edubart/otclient.git
synced 2025-12-24 16:57:11 +01:00
Improve autowalk
This commit is contained in:
@@ -128,13 +128,16 @@ public:
|
||||
Position lastPos = *this;
|
||||
std::vector<Position> positions;
|
||||
|
||||
if(!lastPos.isValid())
|
||||
return positions;
|
||||
|
||||
positions.push_back(lastPos);
|
||||
|
||||
for(auto dir : dirs) {
|
||||
if(lastPos.isValid()) {
|
||||
positions.push_back(lastPos);
|
||||
}
|
||||
lastPos = lastPos.translatedToDirection(dir);
|
||||
if(!lastPos.isValid())
|
||||
break;
|
||||
positions.push_back(lastPos);
|
||||
}
|
||||
|
||||
return positions;
|
||||
|
||||
Reference in New Issue
Block a user