summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-29 03:37:49 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-29 03:37:49 +0300
commitdd46c744a74a3ecbb782d5d59c807bcea88d2365 (patch)
treeaf85b8d6fa4b1d6172b17b84876083b81199c0cc /src/commandhandler.cpp
parent6e190e44b01f5e1780e14e7a60262d3d10e3d48f (diff)
downloadmv-dd46c744a74a3ecbb782d5d59c807bcea88d2365.tar.gz
mv-dd46c744a74a3ecbb782d5d59c807bcea88d2365.tar.bz2
mv-dd46c744a74a3ecbb782d5d59c807bcea88d2365.tar.xz
mv-dd46c744a74a3ecbb782d5d59c807bcea88d2365.zip
Add char command /addpriorityattack.
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 5211c64c3..6b7706a00 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -260,6 +260,10 @@ void CommandHandler::handleCommand(const std::string &command, ChatTab *tab)
{
handleUptime(args, tab);
}
+ else if (type == "addpriorityattack")
+ {
+ handleAddPriorityAttack(args, tab);
+ }
else if (type == "addattack")
{
handleAddAttack(args, tab);
@@ -991,6 +995,19 @@ 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))
+ return;
+
+ player_node->removeAttackMob(args);
+ player_node->addPriorityAttackMob(args);
+
+ if (socialWindow)
+ socialWindow->updateAttackFilter();
+}
+
void CommandHandler::handleAddAttack(const std::string &args,
ChatTab *tab _UNUSED_)
{