summaryrefslogtreecommitdiff
path: root/src/actions/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-27 19:09:14 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-27 19:09:14 +0300
commit1f90dd8fea01c835816b3ed67f07561ae29b6ddc (patch)
treeb77b183ca64ff8161cf55a50a18a7fd3398ee656 /src/actions/commands.cpp
parenteb0c8a2a08a7b55eb80667b106657aeee4023dd9 (diff)
downloadplus-1f90dd8fea01c835816b3ed67f07561ae29b6ddc.tar.gz
plus-1f90dd8fea01c835816b3ed67f07561ae29b6ddc.tar.bz2
plus-1f90dd8fea01c835816b3ed67f07561ae29b6ddc.tar.xz
plus-1f90dd8fea01c835816b3ed67f07561ae29b6ddc.zip
remove "remove from attack list" action from social window popup menu.
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r--src/actions/commands.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 9f38844ee..1a1b07dd5 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -601,7 +601,7 @@ impHandler(addPriorityAttack)
impHandler(addAttack)
{
- if (!actorManager || actorManager->isInAttackList(event.args))
+ if (!actorManager)
return false;
actorManager->removeAttackMob(event.args);
@@ -614,16 +614,27 @@ impHandler(addAttack)
impHandler(removeAttack)
{
- if (!actorManager ||
- event.args.empty() ||
- (!actorManager->isInAttackList(event.args) &&
- !actorManager->isInPriorityAttackList(event.args) &&
- !actorManager->isInIgnoreAttackList(event.args)))
- {
+ if (!actorManager)
return false;
+
+ if (event.args.empty())
+ {
+ if (actorManager->isInAttackList(event.args))
+ {
+ actorManager->removeAttackMob(event.args);
+ actorManager->addIgnoreAttackMob(event.args);
+ }
+ else
+ {
+ actorManager->removeAttackMob(event.args);
+ actorManager->addAttackMob(event.args);
+ }
+ }
+ else
+ {
+ actorManager->removeAttackMob(event.args);
}
- actorManager->removeAttackMob(event.args);
if (socialWindow)
socialWindow->updateAttackFilter();
@@ -632,7 +643,7 @@ impHandler(removeAttack)
impHandler(addIgnoreAttack)
{
- if (!actorManager || actorManager->isInIgnoreAttackList(event.args))
+ if (!actorManager)
return false;
actorManager->removeAttackMob(event.args);