mirror of https://github.com/OpenTTD/OpenTTD
(svn r20497) -Fix [FS#3960]: non-dedicated servers failing to load a game caused the introgame to be the server's game causing desyncs when people tried to join
parent
bdb4ae940d
commit
e1d35cba6d
|
@ -937,6 +937,9 @@ void NetworkDisconnect(bool blocking)
|
||||||
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
|
||||||
|
|
||||||
NetworkClose();
|
NetworkClose();
|
||||||
|
|
||||||
|
/* Reinitialize the UDP stack, i.e. close all existing connections. */
|
||||||
|
NetworkUDPInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -877,6 +877,7 @@ bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory
|
||||||
case SL_OK: return true;
|
case SL_OK: return true;
|
||||||
|
|
||||||
case SL_REINIT:
|
case SL_REINIT:
|
||||||
|
#ifdef ENABLE_NETWORK
|
||||||
if (_network_dedicated) {
|
if (_network_dedicated) {
|
||||||
/*
|
/*
|
||||||
* We need to reinit a network map...
|
* We need to reinit a network map...
|
||||||
|
@ -888,6 +889,11 @@ bool SafeSaveOrLoad(const char *filename, int mode, GameMode newgm, Subdirectory
|
||||||
MakeNewGame(false, true);
|
MakeNewGame(false, true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (_network_server) {
|
||||||
|
/* We can't load the intro game as server, so disconnect first. */
|
||||||
|
NetworkDisconnect();
|
||||||
|
}
|
||||||
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
||||||
switch (ogm) {
|
switch (ogm) {
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue