Give undead units the undead trait...
...even when they wouldn't normally get traits such as leaders in multiplayer games. This is just a temporary hack. Since undead is really applied to a unit type rather than single units, it should be an ability and not a trait. While its a bit late for 1.2, what should probably happen is that undead should be dropped and not living should be changed to an ability rather than a status and all of the undead unit types (plus the miscellanious not living campaign units) should get the not living ability. Undead types already get the not_living status and that is what protects them from poison and plague. The undead trait is used to indicate that, put doesn't really provide the protection.
This commit is contained in:
parent
30a7e712fa
commit
cf8a80c32f
1 changed files with 10 additions and 3 deletions
13
src/unit.cpp
13
src/unit.cpp
|
@ -144,7 +144,10 @@ unit::unit(const game_data* gamedata, unit_map* unitmap, const gamemap* map,
|
|||
generate_traits();
|
||||
underlying_description_ = description_;
|
||||
}else{
|
||||
underlying_description_ = id();
|
||||
underlying_description_ = id();
|
||||
if (race_->name() == "undead") {
|
||||
generate_traits();
|
||||
}
|
||||
}
|
||||
unrenamable_ = false;
|
||||
anim_ = NULL;
|
||||
|
@ -173,7 +176,10 @@ unit::unit(const unit_type* t, int side, bool use_traits, bool dummy_unit, unit_
|
|||
generate_traits();
|
||||
underlying_description_ = description_;
|
||||
}else{
|
||||
underlying_description_ = id();
|
||||
underlying_description_ = id();
|
||||
if (race_->name() == "undead") {
|
||||
generate_traits();
|
||||
}
|
||||
}
|
||||
unrenamable_ = false;
|
||||
anim_ = NULL;
|
||||
|
@ -1012,7 +1018,8 @@ void unit::read(const config& cfg)
|
|||
if(cfg["ai_special"] == "guardian") {
|
||||
set_state("guardian","yes");
|
||||
}
|
||||
if(utils::string_bool(cfg["random_traits"])) {
|
||||
if(utils::string_bool(cfg["random_traits"]) ||
|
||||
race_->name() == "undead") {
|
||||
generate_traits();
|
||||
cfg_["random_traits"] = "";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue