* Accept an engine prototype. XXX - it is possible that the top-company * changes while you are waiting to accept the offer? Then it becomes invalid * @param flags operation to perform * @param engine_id engine-prototype offered * @return the cost of this operation or an error */
| 1037 | * @return the cost of this operation or an error |
| 1038 | */ |
| 1039 | CommandCost CmdWantEnginePreview(DoCommandFlags flags, EngineID engine_id) |
| 1040 | { |
| 1041 | Engine *e = Engine::GetIfValid(engine_id); |
| 1042 | if (e == nullptr || !e->flags.Test(EngineFlag::ExclusivePreview) || e->preview_company != _current_company) return CMD_ERROR; |
| 1043 | |
| 1044 | if (flags.Test(DoCommandFlag::Execute)) AcceptEnginePreview(engine_id, _current_company); |
| 1045 | |
| 1046 | return CommandCost(); |
| 1047 | } |
| 1048 | |
| 1049 | /** |
| 1050 | * Allow or forbid a specific company to use an engine |
nothing calls this directly
no test coverage detected