From b3f70d8d46199524edc590269a73c262899763c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2011 00:07:56 +0300 Subject: Replace most iterator to const_iterator. Some other minor changes. --- src/localplayer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index c91532227..a68cd5ee8 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -902,11 +902,11 @@ void LocalPlayer::inviteToGuild(Being *being) // TODO: Allow user to choose which guild to invite being to // For now, just invite to the first guild you have permissions to invite with - std::map::iterator itr = mGuilds.begin(); - std::map::iterator itr_end = mGuilds.end(); + std::map::const_iterator itr = mGuilds.begin(); + std::map::const_iterator itr_end = mGuilds.end(); for (; itr != itr_end; ++itr) { - if (checkInviteRights(itr->second->getName())) + if (itr->second && checkInviteRights(itr->second->getName())) { Net::getGuildHandler()->invite(itr->second->getId(), being); return; @@ -1813,7 +1813,7 @@ void LocalPlayer::moveToHome() } else { - std::map::iterator iter = + std::map::const_iterator iter = mHomes.find(mMap->getProperty("_realfilename")); if (iter != mHomes.end()) @@ -2996,7 +2996,7 @@ void LocalPlayer::setHome() if (mAction == SIT) { - std::map::iterator iter = mHomes.find(key); + std::map::const_iterator iter = mHomes.find(key); if (iter != mHomes.end()) { @@ -3102,7 +3102,7 @@ void LocalPlayer::saveHomes() std::string homeStr; std::stringstream ss(homeStr); - for (std::map::iterator iter = mHomes.begin(); + for (std::map::const_iterator iter = mHomes.begin(); iter != mHomes.end(); ++iter ) { Vector pos = (*iter).second; @@ -3802,7 +3802,7 @@ void LocalPlayer::updateNavigateList() { if (mMap) { - std::map::iterator iter = + std::map::const_iterator iter = mHomes.find(mMap->getProperty("_realfilename")); if (iter != mHomes.end()) -- cgit v1.2.3-70-g09d2