From 58b3fd0d0b80396912681386cba226d06a238364 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Feb 2018 00:16:15 +0300 Subject: Replace some empty strings to std::string(). --- src/actormanager.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/actormanager.cpp') diff --git a/src/actormanager.cpp b/src/actormanager.cpp index e33229f20..f052edd99 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -718,7 +718,8 @@ bool ActorManager::pickUpAll(const int x1, const int y1, return false; bool finded(false); - const bool allowAll = mPickupItemsSet.find("") != mPickupItemsSet.end(); + const bool allowAll = mPickupItemsSet.find(std::string()) != + mPickupItemsSet.end(); if (!serverBuggy) { for_actorsm @@ -818,7 +819,8 @@ bool ActorManager::pickUpNearest(const int x, const int y, maxdist = maxdist * maxdist; FloorItem *closestItem = nullptr; int dist = 0; - const bool allowAll = mPickupItemsSet.find("") != mPickupItemsSet.end(); + const bool allowAll = mPickupItemsSet.find(std::string()) != + mPickupItemsSet.end(); for_actorsm { @@ -1169,12 +1171,12 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing, beingActorSorter.priorityBeings = &priorityMobsMap; beingActorSorter.specialDistance = specialDistance; beingActorSorter.attackRange = attackRange; - if (ignoreAttackMobs.find("") != ignoreAttackMobs.end()) + if (ignoreAttackMobs.find(std::string()) != ignoreAttackMobs.end()) ignoreDefault = true; - StringIntMapCIter itr = attackMobsMap.find(""); + StringIntMapCIter itr = attackMobsMap.find(std::string()); if (itr != attackMobsMap.end()) defaultAttackIndex = (*itr).second; - itr = priorityMobsMap.find(""); + itr = priorityMobsMap.find(std::string()); if (itr != priorityMobsMap.end()) defaultPriorityIndex = (*itr).second; } @@ -2054,7 +2056,7 @@ void ActorManager::storeAttackList() const bool ActorManager::checkForPickup(const FloorItem *const item) const { - if (mPickupItemsSet.find("") != mPickupItemsSet.end()) + if (mPickupItemsSet.find(std::string()) != mPickupItemsSet.end()) { if (mIgnorePickupItemsSet.find(item->getName()) == mIgnorePickupItemsSet.end()) @@ -2072,7 +2074,7 @@ bool ActorManager::checkForPickup(const FloorItem *const item) const bool ActorManager::checkDefaultPickup() const { - return mPickupItemsSet.find("") != mPickupItemsSet.end(); + return mPickupItemsSet.find(std::string()) != mPickupItemsSet.end(); } void ActorManager::updateEffects(const std::map &addEffects, -- cgit v1.2.3-70-g09d2