From e62ca47b5ec9c8e630933a674c1419d911722f85 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 10 May 2017 00:26:25 +0300 Subject: Add chat command for move monster in attack list into one position up. --- src/actions/commands.cpp | 31 +++++++++++++++++++++++++++++++ src/actions/commands.h | 1 + 2 files changed, 32 insertions(+) (limited to 'src/actions') 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 mobs + = actorManager->getAttackMobs(); + std::list::iterator it = mobs.begin(); + std::list::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 -- cgit v1.2.3-60-g2f50