summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-09-17 20:22:31 +0000
committerdominik <dominik@openttd.org>2004-09-17 20:22:31 +0000
commit431363908e3da8c09676447063b81dfdecf66aa8 (patch)
treed5f626d34803029d410c99d8ef6cba59e14a4f76
parent7e882e8fa38185ea0ad782a7d3a034a0c1a006de (diff)
downloadopenttd-431363908e3da8c09676447063b81dfdecf66aa8.tar.xz
(svn r286) Sorry, little memalloc problem
-rw-r--r--network.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/network.c b/network.c
index 318338ce5..51f98c31e 100644
--- a/network.c
+++ b/network.c
@@ -101,7 +101,7 @@ typedef struct CommandPacket {
TileIndex tile;
byte player;// player id, this is checked by the server.
byte when; // offset from the current max_frame value minus 1. this is set by the server.
- uint32 dp[8];
+ uint32 dp[10];
} CommandPacket;
typedef struct EventPacket {
@@ -481,7 +481,7 @@ void NetworkSendCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, Comman
qp->frame = _frame_counter_max - GetNextSyncFrame();
// calculate the amount of extra bytes.
- nump = 8;
+ nump = 10;
while ( nump != 0 && ((uint32*)_decode_parameters)[nump-1] == 0) nump--;
qp->cp.packet_length = COMMAND_PACKET_BASE_SIZE + nump * sizeof(uint32);
if (nump != 0) memcpy(qp->cp.dp, _decode_parameters, nump * sizeof(uint32));
@@ -671,7 +671,9 @@ static void HandleAckPacket(AckPacket * ap)
static void HandleFilePacket(FilePacketHdr *fp)
{
int n = fp->packet_length - sizeof(FilePacketHdr);
- char *tempfile = str_fmt("%s/networkc.tmp", _path.personal_dir);
+ char tempfile[512];
+
+ sprintf(tempfile, "%s/networkc.tmp", _path.personal_dir);
if (n == 0) {
assert(_networking_queuing);