mail[Wesnoth-commits] r24415 - in /trunk: changelog src/unit.cpp src/unit_types.cpp


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

Header


Content

Posted by koraq on March 08, 2008 - 18:35:
Author: mordante
Date: Sat Mar  8 18:35:03 2008
New Revision: 24415

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24415&view=rev
Log:
Allow 100% defense instead of cutting off at 99% (debian bug #467253).

Modified:
    trunk/changelog
    trunk/src/unit.cpp
    trunk/src/unit_types.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=24415&r1=24414&r2=24415&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Mar  8 18:35:03 2008
@@ -18,6 +18,7 @@
      boolean_equals=
    * [modify_side] can set AI parameters now, using the [ai] syntax 
implemented
      for [side] declarations (patch #984)
+   * allow 100% defense instead of cutting off at 99% (debian bug #467253)
  * miscellaneous and bug fixes:
    * more comprehensive terrain type naming to avoid confusing displays such
      as 'Road (Grassland)' or 'Impassable mountain (Cavewall)'

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=24415&r1=24414&r2=24415&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Sat Mar  8 18:35:03 2008
@@ -2109,8 +2109,8 @@
                        res = atoi(val.c_str());
                }
        }
-       if(res <= 0) {
-               ERR_CONFIG << "Defence '" << res << "' is '<= 0' reset to 
50.\n";
+       if(res < 0) {
+               ERR_CONFIG << "Defence '" << res << "' is '< 0' reset to 
50.\n";
                res = 50;
        }
 

Modified: trunk/src/unit_types.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=24415&r1=24414&r2=24415&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Sat Mar  8 18:35:03 2008
@@ -32,7 +32,7 @@
 #include <cstdlib>
 #include <iostream>
 
-
+#define ERR_CONFIG LOG_STREAM(err, config)
 
 attack_type::attack_type(const config& cfg)
 {
@@ -417,7 +417,8 @@
                res = parent_->defense_modifier(map,terrain);
        }
 
-       if(res <= 0) {
+       if(res < 0) {
+               ERR_CONFIG << "Defence '" << res << "' is '< 0' reset to 
50.\n";
                res = 50;
        }
 




Related Messages


Powered by MHonArc, Updated Sat Mar 08 19:01:43 2008