Merge branch 'master' into jgrpp
# Conflicts: # src/autoreplace_cmd.cpp # src/company_base.h # src/company_gui.cpp # src/cpu.cpp # src/debug.h # src/group.h # src/group_cmd.cpp # src/house.h # src/industry.h # src/newgrf_house.cpp # src/news_type.h # src/openttd.cpp # src/saveload/company_sl.cpp # src/settings_type.h # src/sl/oldloader_sl.cpp # src/story.cpp # src/table/town_land.h # src/viewport.cpp
This commit is contained in:
@@ -2897,7 +2897,7 @@ bool AfterLoadGame()
|
||||
if (IsSavegameVersionBefore(SLV_148)) {
|
||||
for (Object *o : Object::Iterate()) {
|
||||
Owner owner = GetTileOwner(o->location.tile);
|
||||
o->colour = (owner == OWNER_NONE) ? Random() & 0xF : Company::Get(owner)->livery->colour1;
|
||||
o->colour = (owner == OWNER_NONE) ? static_cast<Colours>(GB(Random(), 0, 4)) : Company::Get(owner)->livery->colour1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -310,7 +310,7 @@ struct PLYRChunkHandler : ChunkHandler {
|
||||
Company *c = new (index) Company();
|
||||
SetDefaultCompanySettings(c->index);
|
||||
SlObject((CompanyProperties *)c, slt);
|
||||
_company_colours[index] = (Colours)c->colour;
|
||||
_company_colours[index] = c->colour;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,38 +10,26 @@
|
||||
#include "../stdafx.h"
|
||||
|
||||
#include "saveload.h"
|
||||
#include "../pathfinder/water_regions.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
namespace upstream_sl {
|
||||
|
||||
static const SaveLoad _water_region_desc[] = {
|
||||
SLE_VAR(WaterRegionSaveLoadInfo, initialized, SLE_BOOL),
|
||||
};
|
||||
extern void SlSkipArray();
|
||||
|
||||
struct WRGNChunkHandler : ChunkHandler {
|
||||
WRGNChunkHandler() : ChunkHandler('WRGN', CH_TABLE) {}
|
||||
|
||||
void Save() const override
|
||||
{
|
||||
SlTableHeader(_water_region_desc);
|
||||
}
|
||||
/* Water Region savegame data is no longer used, but still needed for old savegames to load without errors. */
|
||||
struct WaterRegionChunkHandler : ChunkHandler {
|
||||
WaterRegionChunkHandler() : ChunkHandler('WRGN', CH_READONLY)
|
||||
{}
|
||||
|
||||
void Load() const override
|
||||
{
|
||||
const std::vector<SaveLoad> slt = SlTableHeader(_water_region_desc);
|
||||
|
||||
int index;
|
||||
|
||||
while ((index = SlIterateArray()) != -1) {
|
||||
WaterRegionSaveLoadInfo region_info;
|
||||
SlObject(®ion_info, slt);
|
||||
}
|
||||
}
|
||||
SlTableHeader({});
|
||||
SlSkipArray();
|
||||
};
|
||||
};
|
||||
|
||||
static const WRGNChunkHandler WRGN;
|
||||
static const WaterRegionChunkHandler WRGN;
|
||||
static const ChunkHandlerRef water_region_chunk_handlers[] = { WRGN };
|
||||
extern const ChunkHandlerTable _water_region_chunk_handlers(water_region_chunk_handlers);
|
||||
|
||||
|
Reference in New Issue
Block a user