Feature: [GS] Allow non-question type windows to have no buttons

This commit is contained in:
dP
2021-02-02 19:14:26 +03:00
committed by Loïc Guilloux
parent 751f595bb6
commit 91cc414588
6 changed files with 43 additions and 18 deletions

View File

@@ -260,8 +260,9 @@ CommandCost CmdGoalQuestion(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
} else {
if (company != INVALID_COMPANY && !Company::IsValidID(company)) return CMD_ERROR;
}
if (CountBits(button_mask) < 1 || CountBits(button_mask) > 3) return CMD_ERROR;
if (type >= GOAL_QUESTION_TYPE_COUNT) return CMD_ERROR;
uint min_buttons = (type == GQT_QUESTION ? 1 : 0);
if (CountBits(button_mask) < min_buttons || CountBits(button_mask) > 3) return CMD_ERROR;
if (type >= GQT_END) return CMD_ERROR;
if (flags & DC_EXEC) {
if (is_client) {