diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-21 22:44:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-21 22:45:15 +0300 |
commit | 42f47e483da19079a937c4801ca94bd62d8dc970 (patch) | |
tree | 56dc96737e01e04d54357ce7118de3a1f000c516 /src/being/playerrelations.cpp | |
parent | 2d8b9246c8003f1d32ba396bc19cc11bc5a595b2 (diff) | |
download | mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.gz mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.bz2 mv-42f47e483da19079a937c4801ca94bd62d8dc970.tar.xz mv-42f47e483da19079a937c4801ca94bd62d8dc970.zip |
Remove useless else.
Diffstat (limited to 'src/being/playerrelations.cpp')
-rw-r--r-- | src/being/playerrelations.cpp | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/src/being/playerrelations.cpp b/src/being/playerrelations.cpp index f7a8685e6..a1e9a457c 100644 --- a/src/being/playerrelations.cpp +++ b/src/being/playerrelations.cpp @@ -282,34 +282,32 @@ unsigned int PlayerRelationsManager::checkPermissionSilently( { return mDefaultPermissions & flags; } - else - { - const PlayerRelation *const r = (*it).second; - unsigned int permissions = PlayerRelation::RELATION_PERMISSIONS[ - CAST_S32(r->mRelation)]; - switch (r->mRelation) - { - case Relation::NEUTRAL: - permissions = mDefaultPermissions; - break; - - case Relation::FRIEND: - permissions |= mDefaultPermissions; // widen - break; - - case Relation::DISREGARDED: - case Relation::IGNORED: - case Relation::ERASED: - case Relation::BLACKLISTED: - case Relation::ENEMY2: - default: - permissions &= mDefaultPermissions; // narrow - break; - } + const PlayerRelation *const r = (*it).second; + unsigned int permissions = PlayerRelation::RELATION_PERMISSIONS[ + CAST_S32(r->mRelation)]; - return permissions & flags; + switch (r->mRelation) + { + case Relation::NEUTRAL: + permissions = mDefaultPermissions; + break; + + case Relation::FRIEND: + permissions |= mDefaultPermissions; // widen + break; + + case Relation::DISREGARDED: + case Relation::IGNORED: + case Relation::ERASED: + case Relation::BLACKLISTED: + case Relation::ENEMY2: + default: + permissions &= mDefaultPermissions; // narrow + break; } + + return permissions & flags; } bool PlayerRelationsManager::hasPermission(const Being *const being, @@ -455,10 +453,7 @@ void PlayerRelationsManager::ignoreTrade(const std::string &name) const { return; } - else - { - playerRelations.setRelation(name, Relation::BLACKLISTED); - } + playerRelations.setRelation(name, Relation::BLACKLISTED); } bool PlayerRelationsManager::checkBadRelation(const std::string &name) const |