Moved gold initialisation to earlier point, fixing bugs #20853 and #20734

This commit is contained in:
ayne 2013-06-02 18:57:03 +02:00
parent 8e741368f6
commit fddc336495

View file

@ -337,6 +337,11 @@ void carryover_info::transfer_all_to(config& side_cfg){
return;
}
}
//if no carryover was found for this side, check if starting gold is defined
if(!side_cfg.has_attribute("gold") || side_cfg["gold"].empty()){
side_cfg["gold"] = default_gold_qty;
}
}
void carryover_info::transfer_from(game_data& gamedata){
@ -536,10 +541,6 @@ protected:
gold_info_ngold_ = side_cfg_["gold"];
if(gold_info_ngold_ == 0){
gold_info_ngold_ = default_gold_qty;
}
DBG_NG_TC << "set gold to '" << gold_info_ngold_ << "'\n";
//DBG_NG_TC << "set gold add flag to '" << gold_info_add_ << "'\n";
}