summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-08 00:07:56 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-08 00:07:56 +0300
commitb3f70d8d46199524edc590269a73c262899763c7 (patch)
treeaf8e20371f2cc825c0b2dbe0c0e5c392a926c46d /src/localplayer.cpp
parent3f84fc198131ff706e18c56f612e38ff147b0005 (diff)
downloadmanaverse-b3f70d8d46199524edc590269a73c262899763c7.tar.gz
manaverse-b3f70d8d46199524edc590269a73c262899763c7.tar.bz2
manaverse-b3f70d8d46199524edc590269a73c262899763c7.tar.xz
manaverse-b3f70d8d46199524edc590269a73c262899763c7.zip
Replace most iterator to const_iterator.
Some other minor changes.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp14
1 files changed, 7 insertions, 7 deletions
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<int, Guild*>::iterator itr = mGuilds.begin();
- std::map<int, Guild*>::iterator itr_end = mGuilds.end();
+ std::map<int, Guild*>::const_iterator itr = mGuilds.begin();
+ std::map<int, Guild*>::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<std::string, Vector>::iterator iter =
+ std::map<std::string, Vector>::const_iterator iter =
mHomes.find(mMap->getProperty("_realfilename"));
if (iter != mHomes.end())
@@ -2996,7 +2996,7 @@ void LocalPlayer::setHome()
if (mAction == SIT)
{
- std::map<std::string, Vector>::iterator iter = mHomes.find(key);
+ std::map<std::string, Vector>::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<std::string, Vector>::iterator iter = mHomes.begin();
+ for (std::map<std::string, Vector>::const_iterator iter = mHomes.begin();
iter != mHomes.end(); ++iter )
{
Vector pos = (*iter).second;
@@ -3802,7 +3802,7 @@ void LocalPlayer::updateNavigateList()
{
if (mMap)
{
- std::map<std::string, Vector>::iterator iter =
+ std::map<std::string, Vector>::const_iterator iter =
mHomes.find(mMap->getProperty("_realfilename"));
if (iter != mHomes.end())