fixed game synchronization problem

This commit is contained in:
Dave White 2003-10-28 02:35:49 +00:00
parent f715e79865
commit f68ffeaad3
2 changed files with 7 additions and 2 deletions

View file

@ -201,6 +201,8 @@ void play_multiplayer_client(display& disp, game_data& units_data, config& cfg,
return;
}
preferences::set_login(login);
config response;
response.add_child("login")["username"] = login;
network::send_data(response);

View file

@ -462,7 +462,10 @@ bool do_replay(display& disp, const gamemap& map, const game_data& gameinfo,
std::map<gamemap::location,paths::route>::iterator rt =
paths_list.routes.find(dst);
if(rt == paths_list.routes.end()) {
std::cerr << "src cannot get to dst: " << paths_list.routes.size() << "\n";
std::cerr << "src cannot get to dst: "
<< paths_list.routes.size() << " " << (src.x+1)
<< "," << (src.y+1) << "-" << (dst.x+1) << ","
<< (dst.y+1) << "\n";
throw replay::error();
}
@ -473,7 +476,7 @@ bool do_replay(display& disp, const gamemap& map, const game_data& gameinfo,
current_unit.set_movement(rt->second.move_left);
if(map[dst.x][dst.y] == gamemap::TOWER) {
const int orig_owner = tower_owner(dst,teams);
const int orig_owner = tower_owner(dst,teams) + 1;
if(orig_owner != team_num) {
current_unit.set_movement(0);
get_tower(dst,teams,team_num-1);