don't do variable subsitution when parsing [team][village]

Becasue are no posibilities to change the variables or the positions of
the villages before this code happens, i cannot see any common usecase
for this feature, Also it's not documented in the wiki.

Note that it is of course still possible to change village owners
depending on variables in a prestart event.
This commit is contained in:
gfgtdf 2014-12-31 03:24:55 +01:00
parent 9b7b0f3861
commit 9f28fc8f37
4 changed files with 6 additions and 10 deletions

View file

@ -204,7 +204,7 @@ team_builder_ptr game_data::create_team_builder(const config& side_cfg,
std::vector<team>& teams,
const config& level, gamemap& map)
{
return team_builder_ptr(new team_builder(side_cfg, teams, level, map, *this));
return team_builder_ptr(new team_builder(side_cfg, teams, level, map));
}
void game_data::build_team_stage_one(team_builder_ptr tb_ptr)

View file

@ -276,7 +276,7 @@ team::~team()
{
}
void team::build(const config &cfg, const gamemap& map, const game_data * gamedata, int gold)
void team::build(const config &cfg, const gamemap& map, int gold)
{
gold_ = gold;
info_.read(cfg);
@ -310,7 +310,7 @@ void team::build(const config &cfg, const gamemap& map, const game_data * gameda
// Load in the villages the side controls at the start
BOOST_FOREACH(const config &v, cfg.child_range("village"))
{
map_location loc(v, gamedata);
map_location loc(v);
if (map.is_village(loc)) {
villages_.insert(loc);
} else {

View file

@ -167,7 +167,7 @@ public:
/// from a side's config before using it to create the side's leader.
static const std::set<std::string> attributes;
void build(const config &cfg, const gamemap &map, const game_data * gamedata, int gold = default_team_gold_);
void build(const config &cfg, const gamemap &map, int gold = default_team_gold_);
void write(config& cfg) const;

View file

@ -38,8 +38,7 @@ static lg::log_domain log_engine_tc("engine/team_construction");
class team_builder {
public:
team_builder(const config& side_cfg, std::vector<team>& teams,
const config& level, gamemap& map,
game_data & gamedata)
const config& level, gamemap& map)
: gold_info_ngold_(0)
, leader_configs_()
, level_(level)
@ -51,7 +50,6 @@ public:
, t_(NULL)
, teams_(teams)
, unit_configs_()
, gamedata_(gamedata)
{
}
@ -106,8 +104,6 @@ protected:
team *t_;
std::vector<team> &teams_;
std::vector<const config*> unit_configs_;
game_data & gamedata_;
void log_step(const char *s) const
{
@ -163,7 +159,7 @@ protected:
void new_team()
{
log_step("new team");
t_->build(side_cfg_, map_, &gamedata_, gold_info_ngold_);
t_->build(side_cfg_, map_, gold_info_ngold_);
//t_->set_gold_add(gold_info_add_);
}