summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-09-15 18:36:33 +0000
committertruelight <truelight@openttd.org>2004-09-15 18:36:33 +0000
commita69e422cdda77f59e77c8db7bd1b8af0bf8dafdb (patch)
treee7f4d150b64cd500924d16fb14705ca8702375d3 /network.c
parent0346fec1cad4fa96368e3102c2b42d0a85e288e1 (diff)
downloadopenttd-a69e422cdda77f59e77c8db7bd1b8af0bf8dafdb.tar.xz
(svn r266) -Fix: hopefully fixed the desync problem nicely (and reverted the
workaround for it)
Diffstat (limited to 'network.c')
-rw-r--r--network.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/network.c b/network.c
index fde009102..c9aa2a785 100644
--- a/network.c
+++ b/network.c
@@ -365,6 +365,7 @@ void NetworkProcessCommands()
{
CommandQueue *nq;
QueuedCommand *qp;
+ byte old_player;
// queue mode ?
if (_networking_queuing)
@@ -380,11 +381,13 @@ void NetworkProcessCommands()
}
// run the command
+ old_player = _current_player;
_current_player = qp->cp.player;
memcpy(_decode_parameters, qp->cp.dp, (qp->cp.packet_length - COMMAND_PACKET_BASE_SIZE));
DoCommandP(qp->cp.tile, qp->cp.p1, qp->cp.p2, qp->callback, qp->cmd | CMD_DONT_NETWORK);
free(qp);
+ _current_player = old_player;
}
if (!_networking_server) {
@@ -508,7 +511,7 @@ void NetworkSendEvent(uint16 type, uint16 data_len, void * data)
{
EventPacket * ep;
ClientState *cs;
-
+
// encode the event ... add its data
ep=malloc(data_len+sizeof(EventPacket)-1);
ep->event_type = type;