mirror of https://github.com/OpenTTD/OpenTTD
(svn r3246) -Fix: small glitch in ai_network_client code (network_client.c)
-Fix: make sure this glitch can never happen again (ai.c)release/0.4.5
parent
c963c59b67
commit
44c70c24d3
2
ai/ai.c
2
ai/ai.c
|
@ -250,6 +250,8 @@ void AI_LoadAIControl(void)
|
||||||
*/
|
*/
|
||||||
void AI_StartNewAI(PlayerID player)
|
void AI_StartNewAI(PlayerID player)
|
||||||
{
|
{
|
||||||
|
assert(player < MAX_PLAYERS);
|
||||||
|
|
||||||
#ifdef GPMI
|
#ifdef GPMI
|
||||||
/* Keep this in a different IF, because the function can turn _ai.gpmi off!! */
|
/* Keep this in a different IF, because the function can turn _ai.gpmi off!! */
|
||||||
if (_ai.gpmi && _ai.gpmi_mod == NULL)
|
if (_ai.gpmi && _ai.gpmi_mod == NULL)
|
||||||
|
|
|
@ -346,8 +346,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
|
||||||
if (index == _network_own_client_index) {
|
if (index == _network_own_client_index) {
|
||||||
_network_playas = playas;
|
_network_playas = playas;
|
||||||
|
|
||||||
/* Are we a ai-network-client? */
|
/* Are we a ai-network-client? Are we not joining as a SPECTATOR (playas == 0, means SPECTATOR) */
|
||||||
if (_ai.network_client) {
|
if (_ai.network_client && playas != 0) {
|
||||||
if (_ai.network_playas == OWNER_SPECTATOR)
|
if (_ai.network_playas == OWNER_SPECTATOR)
|
||||||
AI_StartNewAI(playas - 1);
|
AI_StartNewAI(playas - 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue