Prevent network games with a computer controlled player, and a decent error
when trying a network game with two network players. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2612 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2150,6 +2150,25 @@ StartMeleeButtonPressed (PMELEE_STATE pMS)
|
||||
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;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user