summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 21:43:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 21:43:19 +0300
commit0888773fc1de5cc2aa1d92564e8d05231189e6f9 (patch)
tree001209ae09a69d15d29007d8a1762de56c94e362
parentac2cda962d5fc3e23858527be45a8ae7b9856b84 (diff)
downloadplus-0888773fc1de5cc2aa1d92564e8d05231189e6f9.tar.gz
plus-0888773fc1de5cc2aa1d92564e8d05231189e6f9.tar.bz2
plus-0888773fc1de5cc2aa1d92564e8d05231189e6f9.tar.xz
plus-0888773fc1de5cc2aa1d92564e8d05231189e6f9.zip
Move chat command /addattack into actions.
-rw-r--r--src/actions/commands.cpp13
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/commands.cpp13
-rw-r--r--src/commands.h5
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
6 files changed, 25 insertions, 17 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index ab45786e1..78a2fc0e5 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -483,4 +483,17 @@ impHandler(addPriorityAttack)
return true;
}
+impHandler(addAttack)
+{
+ if (!actorManager || actorManager->isInAttackList(event.args))
+ return false;
+
+ actorManager->removeAttackMob(event.args);
+ actorManager->addAttackMob(event.args);
+
+ if (socialWindow)
+ socialWindow->updateAttackFilter();
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 2008f865b..a1e7b86f9 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -52,6 +52,7 @@ namespace Actions
decHandler(info);
decHandler(wait);
decHandler(addPriorityAttack);
+ decHandler(addAttack);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index edccdec54..46d2f17ea 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -157,19 +157,6 @@ impHandler(hack)
return true;
}
-impHandler(addAttack)
-{
- if (!actorManager || actorManager->isInAttackList(event.args))
- return false;
-
- actorManager->removeAttackMob(event.args);
- actorManager->addAttackMob(event.args);
-
- if (socialWindow)
- socialWindow->updateAttackFilter();
- return true;
-}
-
impHandler(removeAttack)
{
if (!actorManager || event.args.empty()
diff --git a/src/commands.h b/src/commands.h
index 147b1fb31..b8d6ab829 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -52,7 +52,6 @@ struct CommandInfo final
namespace Commands
{
decHandler(hack);
- decHandler(addAttack);
decHandler(removeAttack);
decHandler(addIgnoreAttack);
decHandler(serverIgnoreAll);
@@ -91,8 +90,7 @@ namespace Commands
enum
{
- COMMAND_ADDATTACK = 0,
- COMMAND_REMOVEATTACK,
+ COMMAND_REMOVEATTACK = 0,
COMMAND_REMOVEIGNOREATTACK,
COMMAND_ADDIGNOREATTACK,
COMMAND_DUMP,
@@ -131,7 +129,6 @@ enum
static const CommandInfo commands[] =
{
- {"addattack", &Commands::addAttack, -1, true},
{"removeattack", Commands::removeAttack, -1, true},
{"removeignoreattack", &Commands::removeAttack, -1, true},
{"addignoreattack", &Commands::addIgnoreAttack, -1, true},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index b9e412e3f..dfdab0777 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -390,6 +390,7 @@ namespace InputAction
WAIT,
UPTIME,
ADD_PRIORITY_ATTACK,
+ ADD_ATTACK,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index f7f8fde27..b7f59361d 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -3279,6 +3279,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"addpriorityattack",
+ true},
+ {"keyAddAttack",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::addAttack,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "addattack",
true}
};