Cache auto-refittability of the vehicle chain. */
| 757 | |
| 758 | /** Cache auto-refittability of the vehicle chain. */ |
| 759 | void UpdateAutoRefitState() |
| 760 | { |
| 761 | this->can_do_refit = false; |
| 762 | this->can_do_autorefit = false; |
| 763 | for (const Vehicle *w = this->vehicle; w != nullptr; w = w->IsGroundVehicle() ? w->Next() : nullptr) { |
| 764 | if (IsEngineRefittable(w->engine_type)) this->can_do_refit = true; |
| 765 | if (Engine::Get(w->engine_type)->info.misc_flags.Test(EngineMiscFlag::AutoRefit)) this->can_do_autorefit = true; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | public: |
| 770 | OrdersWindow(WindowDesc &desc, const Vehicle *v) : Window(desc) |
no test coverage detected