| 1471 | } |
| 1472 | |
| 1473 | Vehicle* Vehicle::GetCar(size_t carIndex) const |
| 1474 | { |
| 1475 | auto car = const_cast<Vehicle*>(this); |
| 1476 | for (; carIndex != 0; carIndex--) |
| 1477 | { |
| 1478 | car = getGameState().entities.GetEntity<Vehicle>(car->next_vehicle_on_train); |
| 1479 | if (car == nullptr) |
| 1480 | { |
| 1481 | LOG_ERROR("Tried to get non-existent car from index!"); |
| 1482 | return nullptr; |
| 1483 | } |
| 1484 | } |
| 1485 | return car; |
| 1486 | } |
| 1487 | |
| 1488 | void Vehicle::SetState(Status vehicleStatus, uint8_t subState) |
| 1489 | { |
no outgoing calls
no test coverage detected