mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r285) Fix: networkc.tmp will be created in user's homedir (Loki|muh)
This commit is contained in:
parent
9d1bf52ce3
commit
7e882e8fa3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user