When declining to buy a company, ask the next company immediately

This commit is contained in:
Jonathan G Rennison
2021-10-24 00:07:54 +01:00
parent a9c2c7288a
commit ec8512e2ea
9 changed files with 45 additions and 2 deletions

View File

@@ -2791,6 +2791,14 @@ struct BuyCompanyWindow : Window {
this->InitNested(window_number);
}
~BuyCompanyWindow()
{
const Company *c = Company::GetIfValid((CompanyID)this->window_number);
if (c != nullptr && HasBit(c->bankrupt_asked, _current_company)) {
DoCommandP(0, this->window_number, 0, CMD_DECLINE_BUY_COMPANY);
}
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
{
switch (widget) {