update to 1.6.0

--HG--
branch : openttd
This commit is contained in:
Pavel Stupnikov
2016-04-02 00:50:09 +03:00
parent fe10aa3cba
commit 5c9ef5a264
223 changed files with 4115 additions and 3050 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: afterload.cpp 27020 2014-10-15 18:31:37Z rubidium $ */
/* $Id: afterload.cpp 27320 2015-06-27 11:46:41Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -16,6 +16,7 @@
#include "../fios.h"
#include "../gamelog_internal.h"
#include "../network/network.h"
#include "../network/network_func.h"
#include "../gfxinit.h"
#include "../viewport_func.h"
#include "../industry.h"
@@ -2951,18 +2952,20 @@ bool AfterLoadGame()
}
/*
* Only keep order-backups for network clients.
* Only keep order-backups for network clients (and when replaying).
* If we are a network server or not networking, then we just loaded a previously
* saved-by-server savegame. There are no clients with a backup, so clear it.
* Furthermore before savegame version 192 the actual content was always corrupt.
*/
if (!_networking || _network_server || IsSavegameVersionBefore(192)) {
#ifndef DEBUG_DUMP_COMMANDS
/* Note: We cannot use CleanPool since that skips part of the destructor
* and then leaks un-reachable Orders in the order pool. */
OrderBackup *ob;
FOR_ALL_ORDER_BACKUPS(ob) {
delete ob;
}
#endif
}

View File

@@ -1,4 +1,4 @@
/* $Id: engine_sl.cpp 27270 2015-05-08 17:23:55Z frosch $ */
/* $Id: engine_sl.cpp 27243 2015-04-23 20:07:07Z frosch $ */
/*
* This file is part of OpenTTD.

View File

@@ -1,4 +1,4 @@
/* $Id: industry_sl.cpp 26482 2014-04-23 20:13:33Z rubidium $ */
/* $Id: industry_sl.cpp 27291 2015-05-21 18:59:11Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -160,14 +160,14 @@ static void Save_ITBL()
/** Load industry-type build data. */
static void Load_ITBL()
{
int index;
for (int i = 0; i < NUM_INDUSTRYTYPES; i++) {
index = SlIterateArray();
assert(index == i);
SlObject(_industry_builder.builddata + i, _industrytype_builder_desc);
for (IndustryType it = 0; it < NUM_INDUSTRYTYPES; it++) {
_industry_builder.builddata[it].Reset();
}
int index;
while ((index = SlIterateArray()) != -1) {
if ((uint)index >= NUM_INDUSTRYTYPES) SlErrorCorrupt("Too many industry builder datas");
SlObject(_industry_builder.builddata + index, _industrytype_builder_desc);
}
index = SlIterateArray();
assert(index == -1);
}
extern const ChunkHandler _industry_chunk_handlers[] = {

View File

@@ -1,4 +1,4 @@
/* $Id: newgrf_sl.cpp 26482 2014-04-23 20:13:33Z rubidium $ */
/* $Id: newgrf_sl.cpp 27278 2015-05-09 10:04:50Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -51,7 +51,7 @@ void Load_NewGRFMapping(OverrideManagerBase &mapping)
int index;
while ((index = SlIterateArray()) != -1) {
if ((uint)index >= max_id) break;
if ((uint)index >= max_id) SlErrorCorrupt("Too many NewGRF entity mappings");
SlObject(&mapping.mapping_ID[index], _newgrf_mapping_desc);
}
}

View File

@@ -1,4 +1,4 @@
/* $Id: saveload.cpp 27003 2014-10-12 18:41:53Z rubidium $ */
/* $Id: saveload.cpp 27278 2015-05-09 10:04:50Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -261,7 +261,7 @@
* 191 26646
* 192 26700
* 193 26802
* 194 26881
* 194 26881 1.5.x
*/
extern const uint16 SAVEGAME_VERSION = 194; ///< Current savegame version of OpenTTD.
@@ -1667,9 +1667,11 @@ static void SlLoadChunk(const ChunkHandler *ch)
case CH_ARRAY:
_sl.array_index = 0;
ch->load_proc();
if (_next_offs != 0) SlErrorCorrupt("Invalid array length");
break;
case CH_SPARSE_ARRAY:
ch->load_proc();
if (_next_offs != 0) SlErrorCorrupt("Invalid array length");
break;
default:
if ((m & 0xF) == CH_RIFF) {