diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 21:39:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 21:39:27 +0300 |
commit | ac2cda962d5fc3e23858527be45a8ae7b9856b84 (patch) | |
tree | 434fcc1c1916df5b8a01d2314f78ead7a4f75877 | |
parent | 17a96c972cd483fa556a79c4cd60e5d7490177a4 (diff) | |
download | ManaVerse-ac2cda962d5fc3e23858527be45a8ae7b9856b84.tar.gz ManaVerse-ac2cda962d5fc3e23858527be45a8ae7b9856b84.tar.bz2 ManaVerse-ac2cda962d5fc3e23858527be45a8ae7b9856b84.tar.xz ManaVerse-ac2cda962d5fc3e23858527be45a8ae7b9856b84.zip |
Move chat command /addpriorityattack into actions.
-rw-r--r-- | src/actions/commands.cpp | 16 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 16 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 |
6 files changed, 28 insertions, 20 deletions
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 |