mail[Wesnoth-commits] r44163 - /trunk/src/builder.cpp


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

Header


Content

Posted by alinktomine on July 15, 2010 - 00:00:
Author: alink
Date: Thu Jul 15 00:00:51 2010
New Revision: 44163

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44163&view=rev
Log:
Fix an off-by-1 error with terrain's layer which sometimes could incorrectly
put images in background instead of foreground.
I didn't see any visible change but possibly fixes or introduces bug with
terrain rules using layer around 0.

Modified:
    trunk/src/builder.cpp

Modified: trunk/src/builder.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/builder.cpp?rev=44163&r1=44162&r2=44163&view=diff
==============================================================================
--- trunk/src/builder.cpp (original)
+++ trunk/src/builder.cpp Thu Jul 15 00:00:51 2010
@@ -79,14 +79,8 @@
                tod_variant = itor->second.second->variants.find("");
 
        if(tod_variant != itor->second.second->variants.end()) {
-               //calculate original y-value and layer from list index
-               int layer = itor->first / BASE_Y_INTERVAL;
-               int basey = itor->first % BASE_Y_INTERVAL;
-
-               if (basey < 0)
-                       basey += BASE_Y_INTERVAL/2;
-               else
-                       basey -= BASE_Y_INTERVAL/2;
+               int layer = itor->second.second->layer;
+               int basey = itor->second.second->basey;
 
                bool is_background = layer < 0 || (layer == 0 && basey < 
UNITPOS);
                imagelist& img_list =




Related Messages


Powered by MHonArc, Updated Thu Jul 15 00:20:04 2010