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:
@@ -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
|
||||
|
Reference in New Issue
Block a user