mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 01:03:22 +00:00
Remove useless parameter and code redundancy
This commit is contained in:
parent
2f937f3de3
commit
c92728f784
@ -496,7 +496,6 @@ unit::unit(const config &cfg, bool use_traits, game_state* state) :
|
||||
|
||||
generate_name(state ? &(state->rng()) : 0);
|
||||
|
||||
game_events::add_events(cfg.child_range("event"), type_);
|
||||
// Make the default upkeep "full"
|
||||
if(cfg_["upkeep"].empty()) {
|
||||
cfg_["upkeep"] = "full";
|
||||
@ -677,8 +676,7 @@ unit& unit::operator=(const unit& u)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void unit::set_game_context(unit_map* /*unitmap*/)
|
||||
void unit::set_game_context()
|
||||
{
|
||||
// In case the unit carries EventWML, apply it now
|
||||
game_events::add_events(cfg_.child_range("event"), type_);
|
||||
@ -891,8 +889,7 @@ void unit::advance_to(const unit_type* t, bool use_traits, game_state* state)
|
||||
heal_all();
|
||||
}
|
||||
|
||||
game_events::add_events(cfg_.child_range("event"), type_);
|
||||
cfg_.clear_children("event");
|
||||
set_game_context();
|
||||
|
||||
set_state(STATE_POISONED,false);
|
||||
set_state(STATE_SLOWED,false);
|
||||
|
@ -75,7 +75,8 @@ public:
|
||||
virtual ~unit();
|
||||
unit& operator=(const unit&);
|
||||
|
||||
void set_game_context(unit_map* unitmap);
|
||||
/** In case the unit carries EventWML, apply it */
|
||||
void set_game_context();
|
||||
|
||||
/** Advances this unit to another type */
|
||||
void advance_to(const unit_type* t, bool use_traits=false, game_state* state = 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user