mail[Wesnoth-commits] r33902 - /trunk/src/titlescreen.cpp


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

Header


Content

Posted by guillaume . melquiond on March 20, 2009 - 08:08:
Author: silene
Date: Fri Mar 20 08:08:31 2009
New Revision: 33902

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33902&view=rev
Log:
Removed config::get_children.

Modified:
    trunk/src/titlescreen.cpp

Modified: trunk/src/titlescreen.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/titlescreen.cpp?rev=33902&r1=33901&r2=33902&view=diff
==============================================================================
--- trunk/src/titlescreen.cpp (original)
+++ trunk/src/titlescreen.cpp Fri Mar 20 08:08:31 2009
@@ -190,12 +190,12 @@
                read_tips_of_day(tips_of_day);
        }
 
-       const config::child_list& tips = tips_of_day.get_children("tip");
-
        // next_tip_of_day rotate tips, so better stay iterator-safe
-       for (size_t t=0; t < tips.size(); t++, next_tip_of_day(tips_of_day)) {
-               const config* tip = tips.front();
-               if (tip == NULL) continue;
+       for (int nb_tips = tips_of_day.child_count("tip"); nb_tips > 0;
+            --nb_tips, next_tip_of_day(tips_of_day))
+       {
+               const config *tip = tips_of_day.child("tip");
+               assert(tip);
 
                const std::vector<std::string> needed_units = 
utils::split((*tip)["encountered_units"],',');
                if (needed_units.empty()) {




Related Messages


Powered by MHonArc, Updated Fri Mar 20 08:20:30 2009