File diff r15576:a72a8cf9455f → r15577:a61e44bed2f3
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -1476,13 +1476,13 @@ static bool LoadOldMapPart1(LoadgameStat
 
			_m[i * 4 + 1].m6 = GB(b, 2, 2);
 
			_m[i * 4 + 2].m6 = GB(b, 4, 2);
 
			_m[i * 4 + 3].m6 = GB(b, 6, 2);
 
		}
 
	}
 

	
 
	return !ls->failed;
 
	return true;
 
}
 

	
 
static bool LoadOldMapPart2(LoadgameState *ls, int num)
 
{
 
	uint i;
 

	
 
@@ -1490,13 +1490,13 @@ static bool LoadOldMapPart2(LoadgameStat
 
		_m[i].type_height = ReadByte(ls);
 
	}
 
	for (i = 0; i < OLD_MAP_SIZE; i++) {
 
		_m[i].m5 = ReadByte(ls);
 
	}
 

	
 
	return !ls->failed;
 
	return true;
 
}
 

	
 
static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
 
{
 
	ReadTTDPatchFlags();
 

	
 
@@ -1545,13 +1545,13 @@ static bool LoadTTDPatchExtraChunks(Load
 
				DEBUG(oldloader, 4, "Skipping unknown extra chunk %X", id);
 
				while (len-- != 0) ReadByte(ls);
 
				break;
 
		}
 
	}
 

	
 
	return !ls->failed;
 
	return true;
 
}
 

	
 
extern TileIndex _cur_tileloop_tile;
 
extern uint16 _disaster_delay;
 
extern byte _trees_tick_ctr;
 
static const OldChunks main_chunk[] = {
 
@@ -1731,17 +1731,23 @@ bool LoadTTDMain(LoadgameState *ls)
 

	
 
	DEBUG(oldloader, 3, "Reading main chunk...");
 
	/* Load the biggest chunk */
 
	SmallStackSafeStackAlloc<byte, OLD_MAP_SIZE * 2> map3;
 
	_old_map3 = map3.data;
 
	_old_vehicle_names = NULL;
 
	if (!LoadChunk(ls, NULL, main_chunk)) {
 
		DEBUG(oldloader, 0, "Loading failed");
 
	try {
 
		if (!LoadChunk(ls, NULL, main_chunk)) {
 
			DEBUG(oldloader, 0, "Loading failed");
 
			free(_old_vehicle_names);
 
			return false;
 
		}
 
	} catch (...) {
 
		free(_old_vehicle_names);
 
		return false;
 
		throw;
 
	}
 

	
 
	DEBUG(oldloader, 3, "Done, converting game data...");
 

	
 
	FixTTDMapArray();
 
	FixTTDDepots();
 

	
 
	/* Fix some general stuff */