1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: strongly type EngineID

This commit is contained in:
Rubidium
2025-02-04 20:55:28 +01:00
committed by rubidium42
parent 17b97e5d1b
commit 7e04651220
10 changed files with 27 additions and 31 deletions

View File

@@ -1332,7 +1332,7 @@ void CommitVehicleListOrderChanges()
{
/* Build a list of EngineIDs. EngineIDs are sequential from 0 up to the number of pool items with no gaps. */
std::vector<EngineID> ordering(Engine::GetNumItems());
std::iota(std::begin(ordering), std::end(ordering), ENGINE_BEGIN);
std::iota(std::begin(ordering), std::end(ordering), EngineID::Begin());
/* Pre-sort engines by scope-grfid and local index */
std::ranges::sort(ordering, EnginePreSort);