updated team persistency to be consistent with player_info entries
This commit is contained in:
parent
2febc8b092
commit
12a99147f7
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue