* Set industry control flags. * @param flags Type of operation. * @param ind_id IndustryID * @param ctlflags IndustryControlFlags * @return Empty cost or an error. */
| 2154 | * @return Empty cost or an error. |
| 2155 | */ |
| 2156 | CommandCost CmdIndustrySetFlags(DoCommandFlags flags, IndustryID ind_id, IndustryControlFlags ctlflags) |
| 2157 | { |
| 2158 | if (_current_company != OWNER_DEITY) return CMD_ERROR; |
| 2159 | |
| 2160 | Industry *ind = Industry::GetIfValid(ind_id); |
| 2161 | if (ind == nullptr) return CMD_ERROR; |
| 2162 | if (!ctlflags.IsValid()) return CMD_ERROR; |
| 2163 | |
| 2164 | if (flags.Test(DoCommandFlag::Execute)) ind->ctlflags = ctlflags; |
| 2165 | |
| 2166 | return CommandCost(); |
| 2167 | } |
| 2168 | |
| 2169 | /** |
| 2170 | * Set industry production. |
nothing calls this directly
no test coverage detected