diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-12-17 21:45:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-12-17 21:45:33 +0300 |
commit | adc96cc9f4247ceafc5fde66055456494861b139 (patch) | |
tree | de2b3d96297bce39f7e487ba135116c5f2aaaf3e | |
parent | dc6de526dbdf0145fa3ac0a65d485f40b1722199 (diff) | |
download | mv-adc96cc9f4247ceafc5fde66055456494861b139.tar.gz mv-adc96cc9f4247ceafc5fde66055456494861b139.tar.bz2 mv-adc96cc9f4247ceafc5fde66055456494861b139.tar.xz mv-adc96cc9f4247ceafc5fde66055456494861b139.zip |
Remove default parameters from actormanager.cpp
-rw-r--r-- | src/actormanager.h | 19 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 10 | ||||
-rw-r--r-- | src/gui/windows/whoisonline.cpp | 3 | ||||
-rw-r--r-- | src/progs/manaplus/actions/actions.cpp | 12 | ||||
-rw-r--r-- | src/progs/manaplus/actions/commands.cpp | 6 | ||||
-rw-r--r-- | src/progs/manaplus/actions/pets.cpp | 3 |
6 files changed, 30 insertions, 23 deletions
diff --git a/src/actormanager.h b/src/actormanager.h index 6fdf8d64c..f254dd12e 100644 --- a/src/actormanager.h +++ b/src/actormanager.h @@ -130,14 +130,15 @@ class ActorManager final: public ConfigListener /** * Returns a being at specific coordinates. */ - Being *findBeing(const int x, const int y, const ActorTypeT - type = ActorType::Unknown) const A_WARN_UNUSED; + Being *findBeing(const int x, + const int y, + const ActorTypeT type) const A_WARN_UNUSED; /** * Returns a being at the specific pixel. */ Being *findBeingByPixel(const int x, const int y, - const AllPlayers allPlayers = AllPlayers_false) + const AllPlayers allPlayers) const A_WARN_UNUSED; /** @@ -195,16 +196,14 @@ class ActorManager final: public ConfigListener * Finds a being by name and (optionally) by type. */ Being *findBeingByName(const std::string &name, - const ActorTypeT - type = ActorType::Unknown) + const ActorTypeT type) const A_WARN_UNUSED; /** * Finds a nearest being by name and (optionally) by type. */ Being *findNearestByName(const std::string &name, - const ActorTypeT &type - = ActorType::Unknown) const A_WARN_UNUSED; + const ActorTypeT &type) const A_WARN_UNUSED; /** * Finds most damaged player, non-enemy and alive @@ -293,7 +292,7 @@ class ActorManager final: public ConfigListener const int y1, const int x2, const int y2, - const bool serverBuggy = false) const; + const bool serverBuggy) const; bool pickUpNearest(const int x, const int y, int maxdist) const; @@ -396,8 +395,8 @@ class ActorManager final: public ConfigListener bool validateBeing(const Being *const aroundBeing, Being *const being, const ActorTypeT &type, - const Being *const excluded = nullptr, - const int maxCost = 20) const A_WARN_UNUSED; + const Being *const excluded, + const int maxCost) const A_WARN_UNUSED; Being *findNearestLivingBeing(const Being *const aroundBeing, const int maxdist, diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index e12bdbdf4..d336c0e00 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1614,16 +1614,16 @@ bool LocalPlayer::pickUpItems(int pickUpType) default: x1 = x; x2 = x; y1 = y; y2 = y; break; } - if (actorManager->pickUpAll(x1, y1, x2, y2)) + if (actorManager->pickUpAll(x1, y1, x2, y2, false)) status = true; break; case 3: - if (actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1)) + if (actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1, false)) status = true; break; case 4: - if (!actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1)) + if (!actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1, false)) { if (actorManager->pickUpNearest(x, y, 4)) status = true; @@ -1635,7 +1635,7 @@ bool LocalPlayer::pickUpItems(int pickUpType) break; case 5: - if (!actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1)) + if (!actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1, false)) { if (actorManager->pickUpNearest(x, y, 8)) status = true; @@ -1647,7 +1647,7 @@ bool LocalPlayer::pickUpItems(int pickUpType) break; case 6: - if (!actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1)) + if (!actorManager->pickUpAll(x - 1, y - 1, x + 1, y + 1, false)) { if (actorManager->pickUpNearest(x, y, 90)) status = true; diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index e123d3941..5be4fa590 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -809,7 +809,8 @@ void WhoIsOnline::setNeutralColor(OnlinePlayer *const player) } } - const Being *const being = actorManager->findBeingByName(nick); + const Being *const being = actorManager->findBeingByName(nick, + ActorType::Player); if (being != nullptr) { const Guild *const guild2 = localPlayer->getGuild(); diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 67eefc568..1a3543aba 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -867,7 +867,8 @@ impHandler(attack) { if (args[0] != ':') { - target = actorManager->findNearestByName(args); + target = actorManager->findNearestByName(args, + ActorType::Unknown); } else { @@ -902,7 +903,8 @@ impHandler(targetAttack) { if (args[0] != ':') { - target = actorManager->findNearestByName(args); + target = actorManager->findNearestByName(args, + ActorType::Unknown); } else { @@ -1244,7 +1246,8 @@ impHandler(undress) } else { - target = actorManager->findNearestByName(args); + target = actorManager->findNearestByName(args, + ActorType::Unknown); } } @@ -1824,7 +1827,8 @@ impHandler(kick) { if (args[0] != ':') { - target = actorManager->findNearestByName(args); + target = actorManager->findNearestByName(args, + ActorType::Unknown); } else { diff --git a/src/progs/manaplus/actions/commands.cpp b/src/progs/manaplus/actions/commands.cpp index 985a17a5f..54b8c28bd 100644 --- a/src/progs/manaplus/actions/commands.cpp +++ b/src/progs/manaplus/actions/commands.cpp @@ -380,7 +380,8 @@ impHandler(setTarget) if ((actorManager == nullptr) || (localPlayer == nullptr)) return false; - Being *const target = actorManager->findNearestByName(event.args); + Being *const target = actorManager->findNearestByName(event.args, + ActorType::Unknown); if (target != nullptr) localPlayer->setTarget(target); return true; @@ -500,7 +501,8 @@ impHandler(navigateTo) if (args.empty()) return true; - Being *const being = actorManager->findBeingByName(args); + Being *const being = actorManager->findBeingByName(args, + ActorType::Unknown); if (being != nullptr) { localPlayer->navigateTo(being->getTileX(), being->getTileY()); diff --git a/src/progs/manaplus/actions/pets.cpp b/src/progs/manaplus/actions/pets.cpp index 25c5f1411..6d0992398 100644 --- a/src/progs/manaplus/actions/pets.cpp +++ b/src/progs/manaplus/actions/pets.cpp @@ -131,7 +131,8 @@ impHandler(catchPet) } else { - target = actorManager->findNearestByName(args); + target = actorManager->findNearestByName(args, + ActorType::Unknown); } } |