fixed game synchronization problem
This commit is contained in:
parent
f715e79865
commit
f68ffeaad3
2 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue