From 7e882e8fa38185ea0ad782a7d3a034a0c1a006de Mon Sep 17 00:00:00 2001 From: dominik Date: Fri, 17 Sep 2004 20:08:35 +0000 Subject: [PATCH] (svn r285) Fix: networkc.tmp will be created in user's homedir (Loki|muh) --- network.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network.c b/network.c index 3bb19907c9..318338ce51 100644 --- a/network.c +++ b/network.c @@ -671,6 +671,8 @@ 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); + if (n == 0) { assert(_networking_queuing); assert(!_networking_sync); @@ -679,7 +681,7 @@ static void HandleFilePacket(FilePacketHdr *fp) // attempt loading the game. _game_mode = GM_NORMAL; - if (SaveOrLoad("networkc.tmp", SL_LOAD) != SL_OK) { + if (SaveOrLoad(tempfile, SL_LOAD) != SL_OK) { NetworkCoreDisconnect(); NetworkHandleSaveGameError(); return; @@ -703,7 +705,7 @@ static void HandleFilePacket(FilePacketHdr *fp) } else { if(!_recv_file) { - _recv_file = fopen("networkc.tmp", "wb"); + _recv_file = fopen(tempfile, "wb"); if (!_recv_file) error("can't open savefile"); } fwrite( (char*)fp + sizeof(*fp), n, 1, _recv_file);