1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 13:39:09 +00:00

Codechange: Use C++ features for train wagon overrides. (#9141)

This removes the need for C-style array management and allows use of iterators to perform wagon override lookups.
This commit is contained in:
2021-04-30 12:03:07 +01:00
committed by GitHub
parent 665a3928e2
commit 3dbd6475fe
4 changed files with 13 additions and 55 deletions

View File

@@ -66,12 +66,6 @@ static_assert(lengthof(_orig_rail_vehicle_info) + lengthof(_orig_road_vehicle_in
const uint EngineOverrideManager::NUM_DEFAULT_ENGINES = _engine_counts[VEH_TRAIN] + _engine_counts[VEH_ROAD] + _engine_counts[VEH_SHIP] + _engine_counts[VEH_AIRCRAFT];
Engine::Engine() :
overrides_count(0),
overrides(nullptr)
{
}
Engine::Engine(VehicleType type, EngineID base)
{
this->type = type;
@@ -136,11 +130,6 @@ Engine::Engine(VehicleType type, EngineID base)
}
}
Engine::~Engine()
{
UnloadWagonOverrides(this);
}
/**
* Checks whether the engine is a valid (non-articulated part of an) engine.
* @return true if enabled