summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-06 19:37:58 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-06 21:57:13 +0300
commite26b64efb9c6b79bbd5d9426af6887e83651e466 (patch)
treeaf915bda2a533558cfecaf363e331d59145e1224 /src/localplayer.cpp
parent0f58a82314ca88b059674c98236f229358f6a80a (diff)
downloadmanaverse-e26b64efb9c6b79bbd5d9426af6887e83651e466.tar.gz
manaverse-e26b64efb9c6b79bbd5d9426af6887e83651e466.tar.bz2
manaverse-e26b64efb9c6b79bbd5d9426af6887e83651e466.tar.xz
manaverse-e26b64efb9c6b79bbd5d9426af6887e83651e466.zip
Move attack filter arrays and methods from localplayer to actorspritemanager class.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 0ab1ca713..81a8e6b89 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -179,7 +179,6 @@ LocalPlayer::LocalPlayer(int id, int subtype):
config.addListener("showJobExp", this);
setShowName(config.getBoolValue("showownname"));
beingInfoCache.clear();
- addAttackMob("");
}
LocalPlayer::~LocalPlayer()
@@ -3812,121 +3811,6 @@ void LocalPlayer::checkNewName(Being *being)
}
}
-void LocalPlayer::removeAttackMob(const std::string &name)
-{
- mPriorityAttackMobs.remove(name);
- mAttackMobs.remove(name);
- mIgnoreAttackMobs.remove(name);
- mPriorityAttackMobsSet.erase(name);
- mAttackMobsSet.erase(name);
- mIgnoreAttackMobsSet.erase(name);
- rebuildAttackMobs();
- rebuildPriorityAttackMobs();
-}
-
-void LocalPlayer::addAttackMob(std::string name)
-{
- int size = getAttackMobsSize();
- if (size > 0)
- {
- int idx = getAttackMobIndex("");
- if (idx + 1 == size)
- {
- std::list<std::string>::iterator itr = mAttackMobs.end();
- -- itr;
- mAttackMobs.insert(itr, name);
- }
- else
- {
- mAttackMobs.push_back(name);
- }
- }
- else
- {
- mAttackMobs.push_back(name);
- }
- mAttackMobsSet.insert(name);
- rebuildAttackMobs();
- rebuildPriorityAttackMobs();
-}
-
-void LocalPlayer::addPriorityAttackMob(std::string name)
-{
- int size = getPriorityAttackMobsSize();
- if (size > 0)
- {
- int idx = getPriorityAttackMobIndex("");
- if (idx + 1 == size)
- {
- std::list<std::string>::iterator itr = mPriorityAttackMobs.end();
- -- itr;
- mPriorityAttackMobs.insert(itr, name);
- }
- else
- {
- mPriorityAttackMobs.push_back(name);
- }
- }
- else
- {
- mPriorityAttackMobs.push_back(name);
- }
- mPriorityAttackMobsSet.insert(name);
- rebuildPriorityAttackMobs();
-}
-
-void LocalPlayer::addIgnoreAttackMob(std::string name)
-{
- mIgnoreAttackMobs.push_back(name);
- mIgnoreAttackMobsSet.insert(name);
- rebuildAttackMobs();
- rebuildPriorityAttackMobs();
-}
-
-void LocalPlayer::rebuildPriorityAttackMobs()
-{
- mPriorityAttackMobsMap.clear();
- std::list<std::string>::iterator i = mPriorityAttackMobs.begin();
- int cnt = 0;
- while (i != mPriorityAttackMobs.end())
- {
- mPriorityAttackMobsMap[*i] = cnt;
- ++ i;
- ++ cnt;
- }
-}
-
-void LocalPlayer::rebuildAttackMobs()
-{
- mAttackMobsMap.clear();
- std::list<std::string>::iterator i = mAttackMobs.begin();
- int cnt = 0;
- while (i != mAttackMobs.end())
- {
- mAttackMobsMap[*i] = cnt;
- ++ i;
- ++ cnt;
- }
-}
-
-int LocalPlayer::getPriorityAttackMobIndex(std::string name)
-{
- std::map<std::string, int>::iterator i = mPriorityAttackMobsMap.find(name);
- if (i == mPriorityAttackMobsMap.end())
- return -1;
-
- return (*i).second;
-}
-
-int LocalPlayer::getAttackMobIndex(std::string name)
-{
- std::map<std::string, int>::iterator i = mAttackMobsMap.find(name);
- if (i == mAttackMobsMap.end())
- return -1;
-
- return (*i).second;
-}
-
void LocalPlayer::resetYellowBar()
{
mInvertDirection = config.resetIntValue("invertMoveDirection");