Codechange: Un-bitstuff the remaining on-map commands.

This commit is contained in:
Michael Lutz
2021-11-21 23:03:44 +01:00
parent c6d7b98808
commit 58cff7b081
24 changed files with 80 additions and 96 deletions

View File

@@ -228,8 +228,7 @@ void CcBuildIndustry(Commands cmd, const CommandCost &result, TileIndex tile, co
{
if (result.Succeeded()) return;
auto [tile_, p1, p2, text] = EndianBufferReader::ToValue<CommandTraits<CMD_BUILD_INDUSTRY>::Args>(data);
uint8 indtype = GB(p1, 0, 8);
auto [tile_, indtype, first_layout, fund, seed] = EndianBufferReader::ToValue<CommandTraits<CMD_BUILD_INDUSTRY>::Args>(data);
if (indtype < NUM_INDUSTRYTYPES) {
const IndustrySpec *indsp = GetIndustrySpec(indtype);
if (indsp->enabled) {
@@ -679,7 +678,7 @@ public:
case WID_DPI_FUND_WIDGET: {
if (this->selected_type != INVALID_INDUSTRYTYPE) {
if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) {
Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, InteractiveRandom(), {});
Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, 0, false, InteractiveRandom());
this->HandleButtonClick(WID_DPI_FUND_WIDGET);
} else {
HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT);
@@ -716,13 +715,13 @@ public:
Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
_ignore_restrictions = true;
Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, (layout_index << 8) | this->selected_type, seed, {});
Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, this->selected_type, layout_index, false, seed);
cur_company.Restore();
old_generating_world.Restore();
_ignore_restrictions = false;
} else {
success = Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, (layout_index << 8) | this->selected_type, seed, {});
success = Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, this->selected_type, layout_index, false, seed);
}
/* If an industry has been built, just reset the cursor and the system */