diff options
author | belugas <belugas@openttd.org> | 2007-08-15 00:49:34 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2007-08-15 00:49:34 +0000 |
commit | fafe33cdd2dfe8252501c7a7b824f8c36dd3c3a3 (patch) | |
tree | 3db01e63b9e6b1620a1c3f32e99f699aeea710e0 /src/industry_cmd.cpp | |
parent | ba8c451485736d1e60d4f5069bcf913dc281e1d2 (diff) | |
download | openttd-fafe33cdd2dfe8252501c7a7b824f8c36dd3c3a3.tar.xz |
(svn r10903) -Feature: [NewGRF] Add support for variable 44 of Variational Action 2 for Industries
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index a592642dd..ce9e15ae8 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1396,7 +1396,7 @@ static bool CheckIfTooCloseToIndustry(TileIndex tile, int type) return true; } -static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const IndustryTileTable *it, const Town *t, Owner owner) +static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const IndustryTileTable *it, byte layout, const Town *t, Owner owner) { const IndustrySpec *indspec = GetIndustrySpec(type); uint32 r; @@ -1443,6 +1443,11 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, int type, const Ind i->construction_type = (_game_mode == GM_EDITOR) ? ICT_SCENARIO_EDITOR : (_generating_world ? ICT_MAP_GENERATION : ICT_NORMAL_GAMEPLAY); + /* Adding 1 here makes it conform to specs of var44 of varaction2 for industries + * 0 = created prior of newindustries + * else, chosen layout + 1 */ + i->selected_layout = layout + 1; + if (!_generating_world) i->last_month_production[0] = i->last_month_production[1] = 0; i->prod_level = 0x10; @@ -1514,7 +1519,7 @@ static Industry *CreateNewIndustryHelper(TileIndex tile, IndustryType type, uint if (flags & DC_EXEC) { if (!custom_shape_check) CheckIfCanLevelIndustryPlatform(tile, DC_EXEC, it, type); - DoCreateNewIndustry(i, tile, type, it, t, OWNER_NONE); + DoCreateNewIndustry(i, tile, type, it, itspec_index, t, OWNER_NONE); i_auto_delete.Detach(); } @@ -2017,6 +2022,7 @@ static const SaveLoad _industry_desc[] = { SLE_CONDVAR(Industry, construction_date, SLE_INT32, 70, SL_MAX_VERSION), SLE_CONDVAR(Industry, construction_type, SLE_UINT8, 70, SL_MAX_VERSION), SLE_CONDVAR(Industry, last_cargo_accepted_at, SLE_INT32, 70, SL_MAX_VERSION), + SLE_CONDVAR(Industry, selected_layout, SLE_UINT8, 73, SL_MAX_VERSION), /* reserve extra space in savegame here. (currently 32 bytes) */ SLE_CONDNULL(32, 2, SL_MAX_VERSION), |