804 /* In case we are a client joining a server... */ |
804 /* In case we are a client joining a server... */ |
805 DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0); |
805 DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0); |
806 #endif /* ENABLE_NETWORK */ |
806 #endif /* ENABLE_NETWORK */ |
807 |
807 |
808 if (p != NULL) { |
808 if (p != NULL) { |
809 if (_local_player == OWNER_SPECTATOR) { |
809 if (_local_player == OWNER_SPECTATOR && (!_ai.network_client || _ai.network_playas == OWNER_SPECTATOR)) { |
810 /* Check if we do not want to be a spectator in network */ |
810 /* Check if we do not want to be a spectator in network */ |
811 if (!_networking || (_network_server && !_network_dedicated) || _network_playas != OWNER_SPECTATOR) { |
811 if (!_networking || (_network_server && !_network_dedicated) || _network_playas != OWNER_SPECTATOR || _ai.network_client) { |
812 _local_player = p->index; |
812 if (_ai.network_client) { |
|
813 /* As ai-network-client, we have our own rulez (disable GUI and stuff) */ |
|
814 _ai.network_playas = p->index; |
|
815 _local_player = OWNER_SPECTATOR; |
|
816 if (_ai.network_playas != OWNER_SPECTATOR) { |
|
817 /* If we didn't join the game as a spectator, activate the AI */ |
|
818 AI_StartNewAI(_ai.network_playas); |
|
819 } |
|
820 } else { |
|
821 _local_player = p->index; |
|
822 } |
813 MarkWholeScreenDirty(); |
823 MarkWholeScreenDirty(); |
814 } |
824 } |
815 } else if (p->index == _local_player) { |
825 } else if (p->index == _local_player) { |
816 DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); |
826 DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); |
817 } |
827 } |