Author: anonymissimus
Date: Mon Oct 17 19:21:22 2011
New Revision: 51519
URL: http://svn.gna.org/viewcvs/wesnoth?rev=51519&view=rev
Log:
reintroduce support for [unit][event]s (fix for bug #16259)
Such events are required a non-empty id=.
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=51519&r1=51518&r2=51519&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Mon Oct 17 19:21:22 2011
@@ -148,6 +148,7 @@
states_(o.states_),
known_boolean_states_(o.known_boolean_states_),
variables_(o.variables_),
+ events_(o.events_),
emit_zoc_(o.emit_zoc_),
state_(o.state_),
@@ -228,6 +229,7 @@
states_(),
known_boolean_states_(known_boolean_state_names_.size(),false),
variables_(),
+ events_(),
emit_zoc_(0),
state_(STATE_STANDING),
overlays_(),
@@ -276,6 +278,11 @@
}
if (const config &variables = cfg.child("variables")) {
variables_ = variables;
+ }
+ const config::const_child_itors& unit_events = cfg.child_range("event");
+ game_events::add_events(unit_events);
+ foreach(const config& unit_event, unit_events) {
+ events_.add_child("event", unit_event);
}
facing_ = map_location::parse_direction(cfg["facing"]);
@@ -567,6 +574,7 @@
states_(),
known_boolean_states_(known_boolean_state_names_.size(),false),
variables_(),
+ events_(),
emit_zoc_(0),
state_(STATE_STANDING),
overlays_(),
@@ -1618,6 +1626,8 @@
cfg.clear_children("variables");
cfg.add_child("variables",variables_);
+ cfg.clear_children("events");
+ cfg.append(events_);
cfg.clear_children("status");
cfg.add_child("status",status_flags);
Modified: trunk/src/unit.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=51519&r1=51518&r2=51519&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Mon Oct 17 19:21:22 2011
@@ -418,6 +418,7 @@
std::vector<bool> known_boolean_states_;
static std::map<std::string, state_t> known_boolean_state_names_;
config variables_;
+ config events_;
bool emit_zoc_;
STATE state_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits