diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 15:40:57 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-05-03 15:40:57 +0200 |
commit | ed8fba0a47d2e498267cbfbf1271bacb76c400e9 (patch) | |
tree | d9e2bec54c051edb9d6c4175c3e5e5532e8d35ce /src/game-server/being.cpp | |
parent | 769030e6bd22faeb760731172c221ae801c04dcc (diff) | |
parent | f6f27a9ffaf72f9856240db1bb788a9efa3e86f0 (diff) | |
download | manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.gz manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.bz2 manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.tar.xz manaserv-ed8fba0a47d2e498267cbfbf1271bacb76c400e9.zip |
Merge branch 'master' into lpc2012
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r-- | src/game-server/being.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index 4ddec981..f3d45305 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -234,12 +234,11 @@ void BeingComponent::move(Entity &entity) * class has been used, because that seems to be the most logical * place extra functionality will be added. */ - for (Path::iterator pathIterator = mPath.begin(); - pathIterator != mPath.end(); pathIterator++) + for (Point &point : mPath) { const unsigned char walkmask = entity.getComponent<ActorComponent>()->getWalkMask(); - if (!map->getWalk(pathIterator->x, pathIterator->y, walkmask)) + if (!map->getWalk(point.x, point.y, walkmask)) { mPath.clear(); break; @@ -498,12 +497,10 @@ void BeingComponent::removeStatusEffect(int id) bool BeingComponent::hasStatusEffect(int id) const { - StatusEffects::const_iterator it = mStatus.begin(); - while (it != mStatus.end()) + for (auto &statusIt : mStatus) { - if (it->second.status->getId() == id) + if (statusIt.second.status->getId() == id) return true; - it++; } return false; } @@ -566,12 +563,12 @@ void BeingComponent::update(Entity &entity) if (it->second.time <= 0 || mAction == DEAD) { StatusEffects::iterator removeIt = it; - it++; // bring this iterator to the safety of the next element + ++it; // bring this iterator to the safety of the next element mStatus.erase(removeIt); } else { - it++; + ++it; } } |