diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-10 17:19:24 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-01-10 17:20:33 +0100 |
commit | f5a394a5051384a930d635da22ccafc6beb1cb84 (patch) | |
tree | d28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/playerrelations.cpp | |
parent | 5757066312cab082378dbc5d8df97dea3fe40af0 (diff) | |
download | mana-client-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz mana-client-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2 mana-client-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz mana-client-f5a394a5051384a930d635da22ccafc6beb1cb84.zip |
Change code style
Diffstat (limited to 'src/playerrelations.cpp')
-rw-r--r-- | src/playerrelations.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 2825d114..98d8ad11 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -63,7 +63,8 @@ class PlayerConfSerialiser : public ConfigurationListManager<std::pair<std::stri if (name.empty()) return container; - if (!(*container)[name]) { + if (!(*container)[name]) + { int v = (int)cobj->getValue(RELATION, PlayerRelation::NEUTRAL); (*container)[name] = new PlayerRelation(static_cast<PlayerRelation::Relation>(v)); } @@ -168,8 +169,11 @@ void PlayerRelationsManager::signalUpdate(const std::string &name) { store(); - for (std::list<PlayerRelationsListener *>::const_iterator it = mListeners.begin(); it != mListeners.end(); it++) + for (std::list<PlayerRelationsListener *>::const_iterator it = mListeners.begin(); + it != mListeners.end(); it++) + { (*it)->updatedPlayer(name); + } } unsigned int PlayerRelationsManager::checkPermissionSilently(const std::string &player_name, unsigned int flags) @@ -177,10 +181,12 @@ unsigned int PlayerRelationsManager::checkPermissionSilently(const std::string & PlayerRelation *r = mRelations[player_name]; if (!r) return mDefaultPermissions & flags; - else { + else + { unsigned int permissions = PlayerRelation::RELATION_PERMISSIONS[r->mRelation]; - switch (r->mRelation) { + switch (r->mRelation) + { case PlayerRelation::NEUTRAL: permissions = mDefaultPermissions; break; @@ -210,9 +216,11 @@ bool PlayerRelationsManager::hasPermission(const std::string &name, unsigned int rejections = flags & ~checkPermissionSilently(name, flags); bool permitted = rejections == 0; - if (!permitted) { + if (!permitted) + { // execute `ignore' strategy, if possible - if (mIgnoreStrategy) { + if (mIgnoreStrategy) + { Player *to_ignore = dynamic_cast<Player *>(beingManager->findBeingByName(name, Being::PLAYER)); if (to_ignore) |