Add debug console command to delete a vehicle ID

This commit is contained in:
Jonathan G Rennison
2021-02-27 20:36:47 +00:00
parent 2cbb42f9a9
commit b931df9934
2 changed files with 31 additions and 0 deletions

View File

@@ -191,6 +191,12 @@ static void RemoveAndSellVehicle(Vehicle *v, bool give_money)
}
}
void ConsoleRemoveVehicle(VehicleID id)
{
Vehicle *v = Vehicle::GetIfValid(id);
if (v->Previous() == nullptr) RemoveAndSellVehicle(v, false);
}
/**
* Check all path reservations, and reserve a new path if the current path is invalid.
*/