mail[Wesnoth-commits] r24563 - in /trunk/src: unit.cpp unit.hpp


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

Header


Content

Posted by esr on March 12, 2008 - 12:59:
Author: esr
Date: Wed Mar 12 12:59:35 2008
New Revision: 24563

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24563&view=rev
Log:
unit:id_ -> unit::type_

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

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=24563&r1=24562&r2=24563&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Wed Mar 12 12:59:35 2008
@@ -89,7 +89,7 @@
            abilities_b_(o.abilities_b_),
 
            advances_to_(o.advances_to_),
-           id_(o.id_),
+           type_(o.type_),
            race_(o.race_),
            name_(o.name_),
            description_(o.description_),
@@ -371,7 +371,7 @@
        teams_ = teams;
 
        // In case the unit carries EventWML, apply it now
-       game_events::add_events(cfg_.get_children("event"),id_);
+       game_events::add_events(cfg_.get_children("event"),type_);
 }
 
 
@@ -550,8 +550,8 @@
 
        if(type_id()!=t->id() || cfg_["gender"] != cfg_["gender_id"]) {
                do_heal = true; // Can't heal until after mods applied.
-               id_ = t->id();
-               cfg_["id"] = id_;
+               type_ = t->id();
+               cfg_["id"] = type_;
                cfg_["gender_id"] = cfg_["gender"];
        }
 
@@ -577,7 +577,7 @@
                heal_all();
        }
 
-       game_events::add_events(cfg_.get_children("event"),id_);
+       game_events::add_events(cfg_.get_children("event"),type_);
 
        set_state("poisoned","");
        set_state("slowed","");
@@ -1249,7 +1249,7 @@
        }
 
        bool type_set = false;
-       id_ = "";
+       type_ = "";
        assert(gamedata_ != NULL);
        if(!(cfg["type"].empty() || cfg["type"] == cfg["id"]) || 
cfg["gender"] != cfg["gender_id"]) {
                std::map<std::string,unit_type>::const_iterator i = 
gamedata_->unit_types.find(cfg["type"]);
@@ -1274,9 +1274,9 @@
                }
        }
        if(cfg_["id"]=="") {
-               id_ = cfg_["type"];
+               type_ = cfg_["type"];
        } else {
-               id_ = cfg_["id"];
+               type_ = cfg_["id"];
        }
        if(!type_set || cfg["race"] != "") {
                const race_map::const_iterator race_it = 
gamedata_->races.find(cfg["race"]);
@@ -1421,7 +1421,7 @@
                cfg_["generate_description"] = "";
        }
 
-       game_events::add_events(cfg_.get_children("event"),id_);
+       game_events::add_events(cfg_.get_children("event"),type_);
        // Make the default upkeep "full"
        if(cfg_["upkeep"].empty()) {
                cfg_["upkeep"] = "full";

Modified: trunk/src/unit.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=24563&r1=24562&r2=24563&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Wed Mar 12 12:59:35 2008
@@ -74,7 +74,7 @@
        const std::vector<std::string> advances_to() const { return 
advances_to_; }
 
        //! The current type id
-       const std::string& type_id() const { return id_; }
+       const std::string& type_id() const { return type_; }
        const unit_type* type() const;
        //! The actual name of the unit
        const std::string& name() const { if (description_.empty()) return 
language_name(); else return description_; }
@@ -298,7 +298,7 @@
                config abilities_b_;
 
        std::vector<std::string> advances_to_;
-       std::string id_;
+       std::string type_;
        const unit_race* race_;
        std::string name_;
        std::string description_;




Related Messages


Powered by MHonArc, Updated Wed Mar 12 13:41:15 2008