diff options
author | rubidium <rubidium@openttd.org> | 2008-07-18 16:40:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-07-18 16:40:29 +0000 |
commit | cde65455acbc10a3f64bb9d43c03b37cdf9b1c55 (patch) | |
tree | 82319a3d42401c6d6fa4944e99863807f05c6f5f /src/network/network_server.cpp | |
parent | 56ad26a3aa231ede631d5bf8cf7e5132b2ff25a1 (diff) | |
download | openttd-cde65455acbc10a3f64bb9d43c03b37cdf9b1c55.tar.xz |
(svn r13731) -Codechange: make a pool of the array of players.
Diffstat (limited to 'src/network/network_server.cpp')
-rw-r--r-- | src/network/network_server.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 21c179877..986b56784 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -89,8 +89,6 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_COMPANY_INFO) NetworkPopulateCompanyInfo(); FOR_ALL_PLAYERS(player) { - if (!player->is_active) continue; - p = NetworkSend_Init(PACKET_SERVER_COMPANY_INFO); p->Send_uint8 (NETWORK_COMPANY_INFO_VERSION); @@ -1299,12 +1297,9 @@ void NetworkPopulateCompanyInfo() uint i; uint16 months_empty; - FOR_ALL_PLAYERS(p) { - if (!p->is_active) { - memset(&_network_player_info[p->index], 0, sizeof(NetworkPlayerInfo)); - continue; - } + memset(_network_player_info, 0, sizeof(_network_player_info)); + FOR_ALL_PLAYERS(p) { // Clean the info but not the password ttd_strlcpy(password, _network_player_info[p->index].password, sizeof(password)); months_empty = _network_player_info[p->index].months_empty; @@ -1436,7 +1431,7 @@ static void NetworkAutoCleanCompanies() /* Go through all the comapnies */ FOR_ALL_PLAYERS(p) { /* Skip the non-active once */ - if (!p->is_active || p->is_ai) continue; + if (p->is_ai) continue; if (!clients_in_company[p->index]) { /* The company is empty for one month more */ |