mail[Wesnoth-commits] r41788 - in /trunk: changelog data/scenario-test.cfg src/actions.cpp src/unit.cpp src/unit.hpp


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

Header


Content

Posted by AI0867 on March 27, 2010 - 03:20:
Author: ai0867
Date: Sat Mar 27 03:20:51 2010
New Revision: 41788

URL: http://svn.gna.org/viewcvs/wesnoth?rev=41788&view=rev
Log:
Untested [unit][status]healable -> unhealable

Modified:
    trunk/changelog
    trunk/data/scenario-test.cfg
    trunk/src/actions.cpp
    trunk/src/unit.cpp
    trunk/src/unit.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=41788&r1=41787&r2=41788&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Mar 27 03:20:51 2010
@@ -7,6 +7,7 @@
    * Updated translations:
  * WML Engine:
    * Deprecated [set_variable]'s random key, use rand instead.
+   * Renamed [unit][status] healable to unhealable so it can default to 'no'
  * Miscellaneous and bug fixes:
    * Defaulted log level to warning again
    * Removed the unused gui2 menu bar

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=41788&r1=41787&r2=41788&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Sat Mar 27 03:20:51 2010
@@ -115,7 +115,7 @@
             name="Unhealable"
             generate_name=yes
             [status]
-                healable=no
+                unhealable=yes
             [/status]
         [/unit]
         [unit]

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=41788&r1=41787&r2=41788&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Sat Mar 27 03:20:51 2010
@@ -1734,7 +1734,7 @@
        // We look for all allied units, then we see if our healer is near 
them.
        for (unit_map::iterator i = units.begin(); i != units.end(); ++i) {
 
-               if (i->second.get_state("not_healable") || 
i->second.incapacitated())
+               if (i->second.get_state("unhealable") || 
i->second.incapacitated())
                        continue;
 
                DBG_NG << "found healable unit at (" << i->first << ")\n";

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=41788&r1=41787&r2=41788&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Sat Mar 27 03:20:51 2010
@@ -44,6 +44,7 @@
 #define DBG_UT LOG_STREAM(debug, log_unit)
 #define LOG_UT LOG_STREAM(info, log_unit)
 #define WRN_UT LOG_STREAM(warn, log_unit)
+#define ERR_UT LOG_STREAM(err, log_unit)
 
 static lg::log_domain log_engine("engine");
 #define ERR_NG LOG_STREAM(err, log_engine)
@@ -435,8 +436,10 @@
        {
                foreach (const config::attribute &st, 
status_flags.attribute_range()) {
                        if (st.first == "healable") {
+                               ERR_UT << "Usage of 'healable' is deprecated, 
use 'unhealable' instead, "
+                                       "support will be removed in 1.9.2.\n";
                                if (!utils::string_bool(st.second, true))
-                                       set_state("not_healable", true);
+                                       set_state("unhealable", true);
                        } else if (utils::string_bool(st.second)) {
                                set_state(st.first, true);
                        }
@@ -1099,8 +1102,7 @@
 {
        std::map<std::string, std::string> all_states;
        foreach (std::string const &s, states_) {
-               if (s == "not_healable") all_states["healable"] = "no";
-               else all_states[s] = "yes";
+               all_states[s] = "yes";
        }
        for (std::map<std::string, state_t>::const_iterator i = 
known_boolean_state_names_.begin(),
             i_end = known_boolean_state_names_.end(); i != i_end; ++i)
@@ -1150,6 +1152,7 @@
        
known_boolean_state_names_map.insert(std::make_pair("petrified",STATE_PETRIFIED));
        
known_boolean_state_names_map.insert(std::make_pair("hidden",STATE_HIDDEN));
        
known_boolean_state_names_map.insert(std::make_pair("not_moved",STATE_NOT_MOVED));
+       
known_boolean_state_names_map.insert(std::make_pair("unhealable",STATE_UNHEALABLE));
        //not sure if "guardian" is a yes/no state.
        
//known_boolean_state_names_map.insert(std::make_pair("guardian",STATE_GUARDIAN));
        return known_boolean_state_names_map;

Modified: trunk/src/unit.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=41788&r1=41787&r2=41788&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Sat Mar 27 03:20:51 2010
@@ -160,7 +160,7 @@
        bool get_state(const std::string& state) const;
        void set_state(const std::string &state, bool value);
        enum state_t { STATE_SLOWED = 0, STATE_POISONED, STATE_PETRIFIED,
-               STATE_HIDDEN, STATE_NOT_MOVED, STATE_UNKNOWN = -1 };
+               STATE_HIDDEN, STATE_NOT_MOVED, STATE_UNHEALABLE, 
STATE_UNKNOWN = -1 };
        void set_state(state_t state, bool value);
        bool get_state(state_t state) const;
        static state_t get_known_boolean_state_id(const std::string &state);




Related Messages


Powered by MHonArc, Updated Sat Mar 27 03:40:16 2010