allow observers of games where no network players are involved
This commit is contained in:
parent
75aaaae033
commit
aa61fe9bb1
2 changed files with 7 additions and 5 deletions
|
@ -66,8 +66,10 @@ std::string recruit_unit(const gamemap& map, int side,
|
|||
if(u == units.end())
|
||||
return string_table["no_leader_to_recruit"];
|
||||
|
||||
if(!map.is_starting_position(u->first))
|
||||
if(!map.is_starting_position(u->first)) {
|
||||
std::cerr << "Leader not on start: leader is on " << (u->first.x+1) << "," << (u->first.y+1) << "\n";
|
||||
return string_table["leader_not_on_start"];
|
||||
}
|
||||
|
||||
if(map.on_board(recruit_location)) {
|
||||
const paths::route& rt = a_star_search(u->first,recruit_location,
|
||||
|
|
|
@ -171,10 +171,6 @@ int connection_acceptor::do_action()
|
|||
|
||||
if(!unclaimed) {
|
||||
std::cerr << "starting game now...\n";
|
||||
config start_game;
|
||||
start_game.children["start_game"].
|
||||
push_back(new config());
|
||||
network::send_data(start_game);
|
||||
return CONNECTIONS_FILLED;
|
||||
}
|
||||
} else {
|
||||
|
@ -235,6 +231,10 @@ bool accept_network_connections(display& disp, config& players)
|
|||
}
|
||||
}
|
||||
|
||||
config start_game;
|
||||
start_game.children["start_game"].push_back(new config());
|
||||
network::send_data(start_game);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue