mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-13 20:00:24 +00:00
Small hack to allow to override a unit's gender in one of the unit class
constructors with a last parameter.
This commit is contained in:
parent
2a877e5ae1
commit
6c3124e26a
@ -340,7 +340,7 @@ unit_race::GENDER unit::generate_gender(const unit_type& type, bool gen, game_st
|
||||
|
||||
unit::unit(unit_map* unitmap, const gamemap* map, const gamestatus* game_status,
|
||||
const std::vector<team>* /*teams*/, const unit_type* t, int side,
|
||||
bool use_traits, bool dummy_unit, unit_race::GENDER gender, std::string variation) :
|
||||
bool use_traits, bool dummy_unit, unit_race::GENDER gender, std::string variation, bool force_gender) :
|
||||
cfg_(),
|
||||
advances_to_(),
|
||||
type_(),
|
||||
@ -361,7 +361,7 @@ unit::unit(unit_map* unitmap, const gamemap* map, const gamestatus* game_status,
|
||||
image_mods_(),
|
||||
unrenamable_(false),
|
||||
side_(side),
|
||||
gender_(dummy_unit ? gender : generate_gender(*t,use_traits)),
|
||||
gender_(dummy_unit||force_gender ? gender : generate_gender(*t,use_traits)),
|
||||
alpha_(),
|
||||
unit_formula_(),
|
||||
unit_loop_formula_(),
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
const config& cfg, bool use_traits=false, game_state* state = 0);
|
||||
/** Initializes a unit from a unit type */
|
||||
unit(const unit_type* t, int side, bool use_traits=false, bool dummy_unit=false, unit_race::GENDER gender=unit_race::MALE, std::string variation="");
|
||||
unit(unit_map* unitmap, const gamemap* map, const gamestatus* game_status, const std::vector<team>* teams, const unit_type* t, int side, bool use_traits=false, bool dummy_unit=false, unit_race::GENDER gender=unit_race::MALE, std::string variation="");
|
||||
unit(unit_map* unitmap, const gamemap* map, const gamestatus* game_status, const std::vector<team>* teams, const unit_type* t, int side, bool use_traits=false, bool dummy_unit=false, unit_race::GENDER gender=unit_race::MALE, std::string variation="", bool force_gender=false);
|
||||
virtual ~unit();
|
||||
unit& operator=(const unit&);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user