diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-10 00:26:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-10 00:26:25 +0300 |
commit | e62ca47b5ec9c8e630933a674c1419d911722f85 (patch) | |
tree | bc320f932c25b1185bf51615cc5a9d50a57c6efe /src/actions/commands.cpp | |
parent | 62d8af5b803c053198afaf4a3bc6018460f1b9f8 (diff) | |
download | plus-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/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 31 |
1 files changed, 31 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 |