summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-10 00:26:25 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-10 00:26:25 +0300
commite62ca47b5ec9c8e630933a674c1419d911722f85 (patch)
treebc320f932c25b1185bf51615cc5a9d50a57c6efe /src/actions
parent62d8af5b803c053198afaf4a3bc6018460f1b9f8 (diff)
downloadplus-e62ca47b5ec9c8e630933a674c1419d911722f85.tar.gz
plus-e62ca47b5ec9c8e630933a674c1419d911722f85.tar.bz2
plus-e62ca47b5ec9c8e630933a674c1419d911722f85.tar.xz
plus-e62ca47b5ec9c8e630933a674c1419d911722f85.zip
Add chat command for move monster in attack list into one position up.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp31
-rw-r--r--src/actions/commands.h1
2 files changed, 32 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 35fd376cc..79ed06f3c 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1895,4 +1895,35 @@ impHandler0(outfitToChat)
return true;
}
+impHandler(moveAttackUp)
+{
+ const std::string args = event.args;
+ const int idx = actorManager->getAttackMobIndex(args);
+ if (idx > 0)
+ {
+ std::list<std::string> mobs
+ = actorManager->getAttackMobs();
+ std::list<std::string>::iterator it = mobs.begin();
+ std::list<std::string>::iterator it2 = it;
+ while (it != mobs.end())
+ {
+ if (*it == args)
+ {
+ -- it2;
+ mobs.splice(it2, mobs, it);
+ actorManager->setAttackMobs(mobs);
+ actorManager->rebuildAttackMobs();
+ break;
+ }
+ ++ it;
+ ++ it2;
+ }
+
+ if (socialWindow)
+ socialWindow->updateAttackFilter();
+ return true;
+ }
+ return false;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 6295b7264..6b97f295e 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -153,6 +153,7 @@ namespace Actions
decHandler(partyExpShare);
decHandler(partyAutoItemShare);
decHandler(outfitToChat);
+ decHandler(moveAttackUp);
} // namespace Actions
#undef decHandler