diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-05-06 19:37:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-05-06 21:57:13 +0300 |
commit | e26b64efb9c6b79bbd5d9426af6887e83651e466 (patch) | |
tree | af915bda2a533558cfecaf363e331d59145e1224 /src/commandhandler.cpp | |
parent | 0f58a82314ca88b059674c98236f229358f6a80a (diff) | |
download | mv-e26b64efb9c6b79bbd5d9426af6887e83651e466.tar.gz mv-e26b64efb9c6b79bbd5d9426af6887e83651e466.tar.bz2 mv-e26b64efb9c6b79bbd5d9426af6887e83651e466.tar.xz mv-e26b64efb9c6b79bbd5d9426af6887e83651e466.zip |
Move attack filter arrays and methods from localplayer to actorspritemanager class.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r-- | src/commandhandler.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index 8d4168e76..537d9645a 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -998,11 +998,14 @@ void CommandHandler::handleUptime(const std::string &args _UNUSED_, void CommandHandler::handleAddPriorityAttack(const std::string &args, ChatTab *tab _UNUSED_) { - if (!player_node || player_node->isInPriorityAttackList(args)) + if (!actorSpriteManager + || actorSpriteManager->isInPriorityAttackList(args)) + { return; + } - player_node->removeAttackMob(args); - player_node->addPriorityAttackMob(args); + actorSpriteManager->removeAttackMob(args); + actorSpriteManager->addPriorityAttackMob(args); if (socialWindow) socialWindow->updateAttackFilter(); @@ -1011,11 +1014,11 @@ void CommandHandler::handleAddPriorityAttack(const std::string &args, void CommandHandler::handleAddAttack(const std::string &args, ChatTab *tab _UNUSED_) { - if (!player_node || player_node->isInAttackList(args)) + if (!actorSpriteManager || actorSpriteManager->isInAttackList(args)) return; - player_node->removeAttackMob(args); - player_node->addAttackMob(args); + actorSpriteManager->removeAttackMob(args); + actorSpriteManager->addAttackMob(args); if (socialWindow) socialWindow->updateAttackFilter(); @@ -1024,10 +1027,13 @@ void CommandHandler::handleAddAttack(const std::string &args, void CommandHandler::handleRemoveAttack(const std::string &args, ChatTab *tab _UNUSED_) { - if (!player_node || args.empty() || !player_node->isInAttackList(args)) + if (!actorSpriteManager || args.empty() + || !actorSpriteManager->isInAttackList(args)) + { return; + } - player_node->removeAttackMob(args); + actorSpriteManager->removeAttackMob(args); if (socialWindow) socialWindow->updateAttackFilter(); @@ -1036,11 +1042,11 @@ void CommandHandler::handleRemoveAttack(const std::string &args, void CommandHandler::handleAddIgnoreAttack(const std::string &args, ChatTab *tab _UNUSED_) { - if (!player_node || player_node->isInIgnoreAttackList(args)) + if (!actorSpriteManager || actorSpriteManager->isInIgnoreAttackList(args)) return; - player_node->removeAttackMob(args); - player_node->addIgnoreAttackMob(args); + actorSpriteManager->removeAttackMob(args); + actorSpriteManager->addIgnoreAttackMob(args); if (socialWindow) socialWindow->updateAttackFilter(); |