0x004AF16A
| 753 | |
| 754 | // 0x004AF16A |
| 755 | void removeAllCargo(CarComponent& carComponent) |
| 756 | { |
| 757 | carComponent.front->secondaryCargo.qty = 0; |
| 758 | carComponent.back->secondaryCargo.qty = 0; |
| 759 | carComponent.body->primaryCargo.qty = 0; |
| 760 | |
| 761 | auto* head = EntityManager::get<VehicleHead>(carComponent.front->head); |
| 762 | if (head == nullptr) |
| 763 | { |
| 764 | throw Exception::RuntimeError("Invalid Vehicle head"); |
| 765 | } |
| 766 | head->updateTrainProperties(); |
| 767 | |
| 768 | Ui::WindowManager::invalidate(Ui::WindowType::vehicle, enumValue(head->id)); |
| 769 | |
| 770 | // Vanilla called updateCargoSprite on the bogies but that does nothing so skipping that. |
| 771 | carComponent.body->updateCargoSprite(); |
| 772 | } |
| 773 | |
| 774 | // 0x004AFFF3 |
| 775 | // esi: frontBogie |
no test coverage detected