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:
Patrick Parker 2006-12-23 07:36:36 +00:00
parent 31b8e090fe
commit eec28080f7
3 changed files with 11 additions and 4 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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;