From dd46c744a74a3ecbb782d5d59c807bcea88d2365 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 Apr 2011 03:37:49 +0300 Subject: Add char command /addpriorityattack. --- src/commandhandler.cpp | 17 +++++++++++++++++ src/commandhandler.h | 3 +++ src/gui/chatwindow.cpp | 1 + 3 files changed, 21 insertions(+) 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_) { diff --git a/src/commandhandler.h b/src/commandhandler.h index 41811be89..bb15c139a 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -276,6 +276,9 @@ class CommandHandler void handleAddAttack(const std::string &args, ChatTab *tab _UNUSED_); + void handleAddPriorityAttack(const std::string &args, + ChatTab *tab _UNUSED_); + void handleRemoveAttack(const std::string &args, ChatTab *tab _UNUSED_); diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 506257047..37a16b429 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -286,6 +286,7 @@ void ChatWindow::fillCommands() mCommands.push_back("/wait"); mCommands.push_back("/uptime"); mCommands.push_back("/addattack "); + mCommands.push_back("/addpriorityattack "); mCommands.push_back("/removeattack "); mCommands.push_back("/addignoreattack "); } -- cgit v1.2.3-60-g2f50