Few minor fixes here and there:

* Fixed miniwindow cancelling (sorry Summ! :D)
* Fixed pathFind to check floor change tiles
* Fixed buying/selling stackable items in pv < 860
* Added force walk to the first step of auto walking for open tibia
This commit is contained in:
BeniS
2013-01-18 18:27:29 +13:00
parent 6ad7269e5a
commit 1500c1d2f2
7 changed files with 38 additions and 14 deletions

View File

@@ -347,6 +347,7 @@ namespace Otc
GameDiagonalAnimatedText = 34,
GameLoginPending = 35,
GameNewSpeedLaw = 36,
GameForceFirstAutoWalkStep = 37,
// 51-100 reserved to be defined in lua
LastGameFeature = 101
};
@@ -363,7 +364,8 @@ namespace Otc
PathFindAllowNullTiles = 1,
PathFindAllowCreatures = 2,
PathFindAllowNonPathable = 4,
PathFindAllowNonWalkable = 8
PathFindAllowNonWalkable = 8,
PathFindAllowChangeFloor = 16
};
enum AutomapFlags

View File

@@ -619,13 +619,17 @@ void Game::autoWalk(std::vector<Otc::Direction> dirs)
if(isFollowing())
cancelFollow();
Otc::Direction direction = dirs.front();
auto it = dirs.begin();
Otc::Direction direction = *it;
if(m_localPlayer->canWalk(direction)) {
TilePtr toTile = g_map.getTile(m_localPlayer->getPosition().translatedToDirection(direction));
if(toTile && toTile->isWalkable() && !m_localPlayer->isAutoWalking()) {
m_localPlayer->preWalk(direction);
//forceWalk(direction);
//dirs.erase(it);
if(getFeature(Otc::GameForceFirstAutoWalkStep)) {
forceWalk(direction);
dirs.erase(it);
}
}
}

View File

@@ -210,7 +210,9 @@ int Item::getSubType()
{
if(isSplash() || isFluidContainer())
return m_countOrSubType;
return 0;
if(g_game.getProtocolVersion() >= 860)
return 0;
return 1;
}
int Item::getCount()

View File

@@ -600,7 +600,7 @@ std::tuple<std::vector<Otc::Direction>, Otc::PathFindResult> Map::findPath(const
but it is breaking normal path finding.
*/
if(!(flags & Otc::PathFindAllowNullTiles) && !tile)
walkFactor = 2.0f;
walkFactor = 3.0f;
if(tile) {
if(!(flags & Otc::PathFindAllowCreatures) && tile->hasCreature())
continue;
@@ -608,6 +608,8 @@ std::tuple<std::vector<Otc::Direction>, Otc::PathFindResult> Map::findPath(const
continue;
if(!(flags & Otc::PathFindAllowNonWalkable) && !tile->isWalkable())
continue;
if(!(flags & Otc::PathFindAllowChangeFloor) && tile->changesFloor())
continue;
}
}