static */
| 176 | } |
| 177 | |
| 178 | /* static */ bool ScriptVehicle::_SellWagonInternal(VehicleID vehicle_id, SQInteger wagon, bool sell_attached_wagons) |
| 179 | { |
| 180 | EnforceCompanyModeValid(false); |
| 181 | EnforcePrecondition(false, IsValidVehicle(vehicle_id) && wagon < GetNumWagons(vehicle_id)); |
| 182 | EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN); |
| 183 | |
| 184 | const Train *v = ::Train::Get(vehicle_id); |
| 185 | while (wagon-- > 0) v = v->GetNextUnit(); |
| 186 | |
| 187 | return ScriptObject::Command<CMD_SELL_VEHICLE>::Do(v->index, sell_attached_wagons, false, INVALID_CLIENT_ID); |
| 188 | } |
| 189 | |
| 190 | /* static */ bool ScriptVehicle::SellWagon(VehicleID vehicle_id, SQInteger wagon) |
| 191 | { |
nothing calls this directly
no test coverage detected