diff options
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 79ed06f3c..d033413bd 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1897,6 +1897,8 @@ impHandler0(outfitToChat) impHandler(moveAttackUp) { + if (!actorManager) + return false; const std::string args = event.args; const int idx = actorManager->getAttackMobIndex(args); if (idx > 0) @@ -1926,4 +1928,40 @@ impHandler(moveAttackUp) return false; } +impHandler(moveAttackDown) +{ + if (!actorManager) + return false; + const std::string args = event.args; + const int idx = actorManager->getAttackMobIndex(args); + const int size = actorManager->getAttackMobsSize(); + if (idx + 1 < size) + { + 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; + if (it2 == mobs.end()) + break; + + mobs.splice(it, mobs, it2); + actorManager->setAttackMobs(mobs); + actorManager->rebuildAttackMobs(); + break; + } + ++ it; + ++ it2; + } + + if (socialWindow) + socialWindow->updateAttackFilter(); + } + return false; +} + } // namespace Actions |