Changeset - r18563:96e85dda9c20
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-12-04 08:20:01
rubidium@openttd.org
(svn r23418) -Fix [FS#4866] (r22958): saves made with the Catalan town name generator would trigger a "savegame corrupt" exception
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/saveload/town_sl.cpp
Show inline comments
 
@@ -263,25 +263,25 @@ static void Load_TOWN()
 

	
 
	while ((index = SlIterateArray()) != -1) {
 
		Town *t = new (index) Town();
 
		SlObject(t, _town_desc);
 

	
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
 
			SlObject(&t->supplied[i], _town_supplied_desc);
 
		}
 
		for (int i = TE_BEGIN; i < TE_END; i++) {
 
			SlObject(&t->received[i], _town_received_desc);
 
		}
 

	
 
		if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST)) {
 
		if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1)) {
 
			SlErrorCorrupt("Invalid town name generator");
 
		}
 

	
 
		if (IsSavegameVersionBefore(166)) continue;
 

	
 
		SlObject(&t->cargo_accepted, GetTileMatrixDesc());
 
		if (t->cargo_accepted.area.w != 0) {
 
			uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
 
			t->cargo_accepted.data = MallocT<uint32>(arr_len);
 
			SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
 

	
 
			/* Rebuild total cargo acceptance. */
0 comments (0 inline, 0 general)