diff --git a/sc2/content/lbm/starcon.txt b/sc2/content/lbm/starcon.txt index 9147cb9ae..5f2a1bebe 100755 --- a/sc2/content/lbm/starcon.txt +++ b/sc2/content/lbm/starcon.txt @@ -2373,3 +2373,10 @@ Game aborted due to loss of synchronisation. Game aborted by the remote player. +#(Only one side at a time can be network controlled.) +Only one side at a time can be network controlled. + + +#(Netplay with a computer-controlled side is currently not possible.) +Netplay with a computer-controlled side is currently not possible. + diff --git a/sc2/src/sc2code/battle.c b/sc2/src/sc2code/battle.c index ce67c0b31..980920b3f 100644 --- a/sc2/src/sc2code/battle.c +++ b/sc2/src/sc2code/battle.c @@ -33,6 +33,7 @@ #include "settings.h" #include "sounds.h" #include "libs/graphics/gfx_common.h" +#include "libs/log.h" #include "libs/mathlib.h" @@ -361,14 +362,14 @@ selectAllShips (SIZE num_ships) if (num_ships != 2) { - fprintf(stderr, "More than two players is not supported.\n"); + log_add (log_Error, "More than two players is not supported.\n"); return FALSE; } if ((PlayerControl[0] & NETWORK_CONTROL) && (PlayerControl[1] & NETWORK_CONTROL)) { - fprintf(stderr, "Only one side at a time can be network " + log_add (log_Error, "Only one side at a time can be network " "controlled.\n"); return FALSE; } diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index a93e6ccaa..2414041a6 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -2149,6 +2149,25 @@ StartMeleeButtonPressed (PMELEE_STATE pMS) PlayMenuSound (MENU_SOUND_FAILURE); return; } + + if ((PlayerControl[0] & NETWORK_CONTROL) && + (PlayerControl[1] & NETWORK_CONTROL)) + { + DrawMeleeStatusMessage (GAME_STRING (NETMELEE_STRING_BASE + 31)); + // "Only one side at a time can be network controlled." + return; + } + + if (((PlayerControl[0] & NETWORK_CONTROL) && + (PlayerControl[1] & COMPUTER_CONTROL)) || + ((PlayerControl[0] & COMPUTER_CONTROL) && + (PlayerControl[1] & NETWORK_CONTROL))) + { + DrawMeleeStatusMessage (GAME_STRING (NETMELEE_STRING_BASE + 32)); + // "Netplay with a computer-controlled side is currently + // not possible." + return; + } #ifdef NETPLAY // Check whether all network parties are ready;