Fix #427: Recursive DoCommandP call issuing CMD_DECLINE_BUY_COMPANY
Ignore shift and pause states for CMD_DECLINE_BUY_COMPANY command
This commit is contained in:
@@ -391,7 +391,7 @@ static const Command _command_proc_table[] = {
|
||||
DEF_CMD(CmdBuyShareInCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_BUY_SHARE_IN_COMPANY
|
||||
DEF_CMD(CmdSellShareInCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_SELL_SHARE_IN_COMPANY
|
||||
DEF_CMD(CmdBuyCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_BUY_COMPANY
|
||||
DEF_CMD(CmdDeclineBuyCompany, 0, CMDT_MONEY_MANAGEMENT ), // CMD_DECLINE_BUY_COMPANY
|
||||
DEF_CMD(CmdDeclineBuyCompany, 0, CMDT_SERVER_SETTING ), // CMD_DECLINE_BUY_COMPANY
|
||||
|
||||
DEF_CMD(CmdFoundTown, CMD_DEITY | CMD_NO_TEST, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_FOUND_TOWN; founding random town can fail only in exec run
|
||||
DEF_CMD(CmdRenameTown, CMD_DEITY | CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_TOWN
|
||||
|
@@ -2892,7 +2892,7 @@ struct BuyCompanyWindow : Window {
|
||||
{
|
||||
const Company *c = Company::GetIfValid((CompanyID)this->window_number);
|
||||
if (c != nullptr && HasBit(c->bankrupt_asked, this->owner)) {
|
||||
DoCommandP(0, this->window_number, 0, CMD_DECLINE_BUY_COMPANY);
|
||||
EnqueueDoCommandP(NewCommandContainerBasic(0, this->window_number, 0, CMD_DECLINE_BUY_COMPANY | CMD_NO_SHIFT_ESTIMATE));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user