Skip to content

Commit

Permalink
Use auto
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo committed Nov 4, 2024
1 parent e19167a commit 85a5a5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,10 @@ bool Map::isSightClear(const Position& fromPos, const Position& toPos, bool same
const Tile* Map::canWalkTo(const Creature& creature, const Position& pos) const
{
if (auto monster = creature.getMonster()) {
auto walk_cache = monster->getWalkCache(pos);
if (walk_cache == WALKCACHE_NOTFOUND) {
auto walkCache = monster->getWalkCache(pos);
if (walkCache == WALKCACHE_NOTFOUND) {
return nullptr;
} else if (walk_cache == WALKCACHE_FOUND) {
} else if (walkCache == WALKCACHE_FOUND) {
return getTile(pos.x, pos.y, pos.z);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ void Monster::updateTileWalkCache(const Tile* tile, const Position& pos)
{
const auto& myPos = getPosition();
if (pos.z == myPos.z) {
int32_t dx = pos.getOffsetX(myPos);
int32_t dy = pos.getOffsetY(myPos);
auto dx = pos.getOffsetX(myPos);
auto dy = pos.getOffsetY(myPos);
updateTileWalkCache(tile, dx, dy);
}
}
Expand Down

0 comments on commit 85a5a5f

Please sign in to comment.