mail[Wesnoth-commits] r33903 - in /trunk/src: config.hpp unit.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:35 2009
New Revision: 33903

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33903&view=rev
Log:
Removed hardly used function.

Modified:
    trunk/src/config.hpp
    trunk/src/unit.cpp

Modified: trunk/src/config.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config.hpp?rev=33903&r1=33902&r2=33903&view=diff
==============================================================================
--- trunk/src/config.hpp (original)
+++ trunk/src/config.hpp Fri Mar 20 08:08:35 2009
@@ -141,16 +141,6 @@
        bool has_attribute(const std::string& key) const {return 
values.find(key) != values.end();}
        void remove_attribute(const std::string& key) {values.erase(key);}
 
-       /**
-        * This should only be used if there is no mapping of the key already,
-        * e.g. when creating a new config object. It does not replace an 
existing value.
-        * @returns true when it added the key-value pair, false if it 
already existed
-        *          (and you probably wanted to use config[key] = value)
-        */
-       bool init_attribute(const std::string& key, const t_string& value) {
-               return values.insert(string_map::value_type(key, 
value)).second;
-       }
-
        config* find_child(const std::string& key, const std::string& name,
                           const t_string& value);
        const config* find_child(const std::string& key, const std::string& 
name,

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=33903&r1=33902&r2=33903&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Fri Mar 20 08:08:35 2009
@@ -2780,7 +2780,8 @@
                        variation_ = (last_effect)["name"];
                        advance_to(this->type());
                } else if ((last_effect)["apply_to"] == "type") {
-                       new_child->init_attribute("prev_type", type_id());
+                       if (!new_child->has_attribute("prev_type"))
+                               (*new_child)["prev_type"] = type_id();
                        type_ = (last_effect)["name"];
                        int hit_points = hit_points_;
                        int experience = experience_;




Related Messages


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