(svn r16242) -Codechange: rework pausing

-Fix [FS#2864]: autopause and manual pausing conflict with eachother
-Fix: new game + pause on new game + autopause make the game not unpause on the first join
This commit is contained in:
rubidium
2009-05-06 15:06:57 +00:00
parent bb121a1510
commit 2664f2a2d9
29 changed files with 110 additions and 79 deletions

View File

@@ -23,6 +23,7 @@
#include "../company_gui.h"
#include "../settings_type.h"
#include "../window_func.h"
#include "../openttd.h"
#include "table/strings.h"
@@ -820,7 +821,7 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_MAP_OK)
if (_settings_client.network.pause_on_join) {
/* Now pause the game till the client is in sync */
DoCommandP(0, 1, 0, CMD_PAUSE);
DoCommandP(0, PM_PAUSED_JOIN, 1, CMD_PAUSE);
NetworkServerSendChat(NETWORK_ACTION_SERVER_MESSAGE, DESTTYPE_BROADCAST, 0, "", CLIENT_ID_SERVER, NETWORK_SERVER_MESSAGE_GAME_PAUSED_CONNECT);
}
@@ -1013,8 +1014,8 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_ACK)
/* Now he is! Unpause the game */
cs->status = STATUS_ACTIVE;
if (_settings_client.network.pause_on_join) {
DoCommandP(0, 0, 0, CMD_PAUSE);
if (_pause_mode & PM_PAUSED_JOIN) {
DoCommandP(0, PM_PAUSED_JOIN, 0, CMD_PAUSE);
NetworkServerSendChat(NETWORK_ACTION_SERVER_MESSAGE, DESTTYPE_BROADCAST, 0, "", CLIENT_ID_SERVER, NETWORK_SERVER_MESSAGE_GAME_UNPAUSED_CONNECT);
}