mail[Wesnoth-commits] r33899 - in /trunk/src: game_events.cpp game_events.hpp play_controller.cpp 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:18 2009
New Revision: 33899

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33899&view=rev
Log:
Removed config::child_list from game_events.hpp.

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

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=33899&r1=33898&r2=33899&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Fri Mar 20 08:08:18 2009
@@ -3691,13 +3691,13 @@
                return pump();
        }
 
-       void add_events(const config::child_list& cfgs,const std::string& id)
+       void add_events(const config::const_child_itors &cfgs, const 
std::string &id)
        {
                if(std::find(unit_wml_ids.begin(),unit_wml_ids.end(),id) == 
unit_wml_ids.end()) {
                        unit_wml_ids.insert(id);
-                       for(config::child_list::const_iterator new_ev = 
cfgs.begin(); new_ev != cfgs.end(); ++ new_ev) {
+                       foreach (const config &new_ev, cfgs) {
                                std::vector<game_events::event_handler> &temp 
= (pump_manager::count()) ? new_handlers : event_handlers;
-                               
temp.push_back(game_events::event_handler(vconfig(*new_ev, true)));
+                               
temp.push_back(game_events::event_handler(vconfig(&new_ev, true)));
                        }
                }
        }

Modified: trunk/src/game_events.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.hpp?rev=33899&r1=33898&r2=33899&view=diff
==============================================================================
--- trunk/src/game_events.hpp (original)
+++ trunk/src/game_events.hpp Fri Mar 20 08:08:18 2009
@@ -279,7 +279,7 @@
 
        game_state* get_state_of_game();
        void write_events(config& cfg);
-       void add_events(const config::child_list& cfgs,const std::string& id);
+       void add_events(const config::const_child_itors &cfgs,const 
std::string& id);
 
        bool unit_matches_filter(unit_map::const_iterator itor, const vconfig 
filter);
 

Modified: trunk/src/play_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/play_controller.cpp?rev=33899&r1=33898&r2=33899&view=diff
==============================================================================
--- trunk/src/play_controller.cpp (original)
+++ trunk/src/play_controller.cpp Fri Mar 20 08:08:18 2009
@@ -184,7 +184,7 @@
        // add era events for MP game
        const config* era_cfg = level_.child("era");
        if (era_cfg != NULL) {
-               
game_events::add_events(era_cfg->get_children("event"),"era_events");
+               game_events::add_events(era_cfg->child_range("event"), 
"era_events");
        }
 
 

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=33899&r1=33898&r2=33899&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Fri Mar 20 08:08:18 2009
@@ -578,7 +578,7 @@
        gamestatus_ = game_status;
 
        // In case the unit carries EventWML, apply it now
-       game_events::add_events(cfg_.get_children("event"),type_);
+       game_events::add_events(cfg_.child_range("event"), type_);
 }
 
 // Apply mandatory traits (e.g. undead, mechanical) to a unit and then
@@ -763,7 +763,7 @@
                heal_all();
        }
 
-       game_events::add_events(cfg_.get_children("event"),type_);
+       game_events::add_events(cfg_.child_range("event"), type_);
 
        set_state("poisoned","");
        set_state("slowed","");
@@ -1562,7 +1562,7 @@
                cfg_["generate_name"] = "";
        }
 
-       game_events::add_events(cfg_.get_children("event"),type_);
+       game_events::add_events(cfg_.child_range("event"), type_);
        // Make the default upkeep "full"
        if(cfg_["upkeep"].empty()) {
                cfg_["upkeep"] = "full";




Related Messages


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