mail[Wesnoth-commits] r33714 - /trunk/src/game_preferences.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by soliton . de on March 15, 2009 - 22:32:
Author: soliton
Date: Sun Mar 15 22:32:23 2009
New Revision: 33714

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33714&view=rev
Log:
initialize the friends/ignores list also when checking for matches

Modified:
    trunk/src/game_preferences.cpp

Modified: trunk/src/game_preferences.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_preferences.cpp?rev=33714&r1=33713&r2=33714&view=diff
==============================================================================
--- trunk/src/game_preferences.cpp (original)
+++ trunk/src/game_preferences.cpp Sun Mar 15 22:32:23 2009
@@ -154,7 +154,7 @@
        }
 }
 
-const std::set<std::string> & get_friends() {
+void initialize_friends() {
        if(!friends_initialized) {
                std::vector<std::string> names = 
utils::split(preferences::get("friends"));
                std::set<std::string> tmp(names.begin(), names.end());
@@ -162,11 +162,14 @@
 
                friends_initialized = true;
        }
-
+}
+
+const std::set<std::string> & get_friends() {
+       initialize_friends();
        return friends;
 }
 
-const std::set<std::string> & get_ignores() {
+void initialize_ignores() {
        if(!ignores_initialized) {
                std::vector<std::string> names = 
utils::split(preferences::get("ignores"));
                std::set<std::string> tmp(names.begin(), names.end());
@@ -174,7 +177,9 @@
 
                ignores_initialized = true;
        }
-
+}
+
+const std::set<std::string> & get_ignores() {
        return ignores;
 }
 
@@ -217,10 +222,12 @@
 }
 
 bool is_friend(const std::string& nick) {
+       initialize_friends();
        return friends.find(nick) != friends.end();
 }
 
 bool is_ignored(const std::string& nick) {
+       initialize_ignores();
        return ignores.find(nick) != ignores.end();
 }
 




Related Messages


Powered by MHonArc, Updated Sun Mar 15 22:40:37 2009