merge 2006-12-23T07:00:45Z!patrick_x99@hotmail.com to the trunk,
...and fixes platform-specific loop scoping error (again!)
This commit is contained in:
parent
31b8e090fe
commit
eec28080f7
3 changed files with 11 additions and 4 deletions
|
@ -251,7 +251,8 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
|
|||
gamestate_.scenario != "null";
|
||||
|
||||
//save current_player name to reuse it when setting next_scenario side info
|
||||
for (std::vector<team>::iterator i = teams_.begin(); i != teams_.end(); ++i) {
|
||||
std::vector<team>::iterator i;
|
||||
for (i = teams_.begin(); i != teams_.end(); ++i) {
|
||||
player_info *player=gamestate_.get_player(i->save_id());
|
||||
if (player)
|
||||
player->name = i->current_player();
|
||||
|
@ -271,7 +272,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
|
|||
//'continue' is like a victory, except it doesn't announce victory,
|
||||
//and the player retains 100% of gold.
|
||||
if(end_level.result == LEVEL_CONTINUE || end_level.result == LEVEL_CONTINUE_NO_SAVE) {
|
||||
for(std::vector<team>::iterator i=teams_.begin(); i!=teams_.end(); ++i) {
|
||||
for(i=teams_.begin(); i!=teams_.end(); ++i) {
|
||||
player_info *player=gamestate_.get_player(i->save_id());
|
||||
if(player) {
|
||||
player->gold = i->gold();
|
||||
|
@ -283,8 +284,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
|
|||
|
||||
|
||||
std::stringstream report;
|
||||
|
||||
for(std::vector<team>::iterator i=teams_.begin(); i!=teams_.end(); ++i) {
|
||||
for(i=teams_.begin(); i!=teams_.end(); ++i) {
|
||||
if (!i->is_persistent())
|
||||
continue;
|
||||
|
||||
|
|
|
@ -932,6 +932,11 @@ bool do_replay(display& disp, const gamemap& map, const game_data& gameinfo,
|
|||
std::pair<gamemap::location,unit> *up = units.extract(u->first);
|
||||
up->first = dst;
|
||||
units.add(up);
|
||||
if (up->first == up->second.get_goto())
|
||||
{
|
||||
//if unit has arrived to destination, goto variable is cleaned
|
||||
up->second.set_goto(gamemap::location());
|
||||
}
|
||||
up->second.set_standing(disp,up->first);
|
||||
u = units.find(dst);
|
||||
check_checksums(disp,units,*cfg);
|
||||
|
|
|
@ -231,6 +231,7 @@ unit::unit(const game_data* gamedata, unit_map* unitmap, const gamemap* map,
|
|||
gender_(dummy_unit ? gender : generate_gender(*t,use_traits)), resting_(false), state_(STATE_STANDING), facing_(gamemap::location::NORTH_EAST),draw_bars_(false),
|
||||
gamedata_(gamedata),units_(unitmap),map_(map),gamestatus_(game_status),teams_(teams)
|
||||
{
|
||||
goto_ = gamemap::location();
|
||||
side_ = side;
|
||||
movement_ = 0;
|
||||
attacks_left_ = 0;
|
||||
|
@ -263,6 +264,7 @@ unit::unit(const unit_type* t, int side, bool use_traits, bool dummy_unit, unit_
|
|||
gender_(dummy_unit ? gender : generate_gender(*t,use_traits)),state_(STATE_STANDING),facing_(gamemap::location::NORTH_EAST),draw_bars_(false),
|
||||
gamedata_(NULL), units_(NULL),map_(NULL),gamestatus_(NULL),teams_(NULL)
|
||||
{
|
||||
goto_ = gamemap::location();
|
||||
side_ = side;
|
||||
movement_ = 0;
|
||||
attacks_left_ = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue