From ac2cda962d5fc3e23858527be45a8ae7b9856b84 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Aug 2014 21:39:27 +0300 Subject: Move chat command /addpriorityattack into actions. --- src/actions/commands.cpp | 16 ++++++++++++++++ src/actions/commands.h | 1 + src/commands.cpp | 16 ---------------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ 6 files changed, 28 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 717c7df09..ab45786e1 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -467,4 +467,20 @@ impHandler(wait) return false; } +impHandler(addPriorityAttack) +{ + if (!actorManager + || actorManager->isInPriorityAttackList(event.args)) + { + return false; + } + + actorManager->removeAttackMob(event.args); + actorManager->addPriorityAttackMob(event.args); + + if (socialWindow) + socialWindow->updateAttackFilter(); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index e2b2eefec..2008f865b 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -51,6 +51,7 @@ namespace Actions decHandler(sendMail); decHandler(info); decHandler(wait); + decHandler(addPriorityAttack); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 29e850208..edccdec54 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,22 +157,6 @@ impHandler(hack) return true; } -impHandler(addPriorityAttack) -{ - if (!actorManager - || actorManager->isInPriorityAttackList(event.args)) - { - return false; - } - - actorManager->removeAttackMob(event.args); - actorManager->addPriorityAttackMob(event.args); - - if (socialWindow) - socialWindow->updateAttackFilter(); - return true; -} - impHandler(addAttack) { if (!actorManager || actorManager->isInAttackList(event.args)) diff --git a/src/commands.h b/src/commands.h index ce517c047..147b1fb31 100644 --- a/src/commands.h +++ b/src/commands.h @@ -53,7 +53,6 @@ namespace Commands { decHandler(hack); decHandler(addAttack); - decHandler(addPriorityAttack); decHandler(removeAttack); decHandler(addIgnoreAttack); decHandler(serverIgnoreAll); @@ -92,8 +91,7 @@ namespace Commands enum { - COMMAND_ADDPRIORITYATTACK = 0, - COMMAND_ADDATTACK, + COMMAND_ADDATTACK = 0, COMMAND_REMOVEATTACK, COMMAND_REMOVEIGNOREATTACK, COMMAND_ADDIGNOREATTACK, @@ -133,7 +131,6 @@ enum static const CommandInfo commands[] = { - {"addpriorityattack", &Commands::addPriorityAttack, -1, true}, {"addattack", &Commands::addAttack, -1, true}, {"removeattack", Commands::removeAttack, -1, true}, {"removeignoreattack", &Commands::removeAttack, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 028b384bb..b9e412e3f 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -389,6 +389,7 @@ namespace InputAction INFO, WAIT, UPTIME, + ADD_PRIORITY_ATTACK, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index ce06d13fe..f7f8fde27 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3271,6 +3271,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "uptime", false}, + {"keyAddPriorityAttack", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::addPriorityAttack, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "addpriorityattack", + true} }; #endif // INPUT_INPUTACTIONMAP_H -- cgit v1.2.3-70-g09d2