mail[Wesnoth-commits] r44279 - /trunk/src/tod_manager.cpp


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

Header


Content

Posted by guillaume . melquiond on July 18, 2010 - 09:47:
Author: silene
Date: Sun Jul 18 09:47:50 2010
New Revision: 44279

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44279&view=rev
Log:
Handled ToD areas in a LIFO way, so that it is possible to override them 
without first removing them. (Fix for bug #16219.)

Modified:
    trunk/src/tod_manager.cpp

Modified: trunk/src/tod_manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tod_manager.cpp?rev=44279&r1=44278&r2=44279&view=diff
==============================================================================
--- trunk/src/tod_manager.cpp (original)
+++ trunk/src/tod_manager.cpp Sun Jul 18 09:47:50 2010
@@ -122,15 +122,14 @@
 {
        time_of_day res = get_time_of_day_turn(n_turn);
 
-       if(loc.valid()) {
-               for(std::vector<area_time_of_day>::const_iterator i = 
areas_.begin(); i != areas_.end(); ++i) {
-                       if(i->hexes.count(loc) == 1) {
-
-                               VALIDATE(i->times.size(), _("No time of day 
has been defined."));
-
-                               res = i->times[(n_turn-1)%i->times.size()];
-                               break;
-                       }
+       if (loc.valid()) {
+               for (std::vector<area_time_of_day>::const_reverse_iterator
+                    i = areas_.rbegin(), i_end = areas_.rend(); i != i_end; 
++i)
+               {
+                       if (i->hexes.count(loc) != 1) continue;
+                       VALIDATE(i->times.size(), _("No time of day has been 
defined."));
+                       res = i->times[(n_turn - 1) % i->times.size()];
+                       break;
                }
        }
 




Related Messages


Powered by MHonArc, Updated Sun Jul 18 10:00:11 2010