|
@@ -1431,31 +1431,31 @@ static void NetworkAutoCleanCompanies()
|
|
|
}
|
|
|
|
|
|
/* Go through all the comapnies */
|
|
|
FOR_ALL_PLAYERS(p) {
|
|
|
/* Skip the non-active once */
|
|
|
if (p->is_ai) continue;
|
|
|
|
|
|
if (!clients_in_company[p->index]) {
|
|
|
/* The company is empty for one month more */
|
|
|
_network_player_info[p->index].months_empty++;
|
|
|
|
|
|
/* Is the company empty for autoclean_unprotected-months, and is there no protection? */
|
|
|
if (_network_player_info[p->index].months_empty > _settings_client.network.autoclean_unprotected && _network_player_info[p->index].password[0] == '\0') {
|
|
|
if (_settings_client.network.autoclean_unprotected != 0 && _network_player_info[p->index].months_empty > _settings_client.network.autoclean_unprotected && _network_player_info[p->index].password[0] == '\0') {
|
|
|
/* Shut the company down */
|
|
|
DoCommandP(0, 2, p->index, NULL, CMD_PLAYER_CTRL);
|
|
|
IConsolePrintF(CC_DEFAULT, "Auto-cleaned company #%d", p->index + 1);
|
|
|
}
|
|
|
/* Is the compnay empty for autoclean_protected-months, and there is a protection? */
|
|
|
if (_network_player_info[p->index].months_empty > _settings_client.network.autoclean_protected && _network_player_info[p->index].password[0] != '\0') {
|
|
|
if (_settings_client.network.autoclean_protected != 0 && _network_player_info[p->index].months_empty > _settings_client.network.autoclean_protected && _network_player_info[p->index].password[0] != '\0') {
|
|
|
/* Unprotect the company */
|
|
|
_network_player_info[p->index].password[0] = '\0';
|
|
|
IConsolePrintF(CC_DEFAULT, "Auto-removed protection from company #%d", p->index+1);
|
|
|
_network_player_info[p->index].months_empty = 0;
|
|
|
}
|
|
|
} else {
|
|
|
/* It is not empty, reset the date */
|
|
|
_network_player_info[p->index].months_empty = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|