updated team persistency to be consistent with player_info entries

This commit is contained in:
Eugen Jiresch 2009-07-01 13:22:51 +00:00
parent 2febc8b092
commit 12a99147f7
2 changed files with 7 additions and 1 deletions

View file

@ -467,7 +467,8 @@ LEVEL_RESULT playsingle_controller::play_scenario(
player_info *player=gamestate_.get_player(i->save_id());
if (player) {
//assert consistency between player_info and persistence of teams
assert(i->persistent());
int carryover_gold = ((i->gold() + finishing_bonus) * end_level.carryover_percentage) / 100;
// Store the gold for all players.
player->gold = carryover_gold;

View file

@ -218,6 +218,7 @@ team::team_info::team_info(const config& cfg) :
}
std::string control = cfg["controller"];
persistent = true; //FIXME: persistence is set based on the side controller, to be consistent with player_info until it is removed
if (control == "human")
controller = HUMAN;
else if (control == "human_ai")
@ -230,9 +231,13 @@ team::team_info::team_info(const config& cfg) :
{
disallow_observers = utils::string_bool(cfg["disallow_observers"],true);
controller = EMPTY;
persistent = false;
}
else
{
controller = AI;
persistent = false;
}
//========================================================
//END OF MESSY CODE