Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement to use .base() means the conversion is still explicit.
This commit is contained in:
@@ -139,7 +139,7 @@
|
||||
if (!IsValidEngine(engine_id)) return -1;
|
||||
if (GetVehicleType(engine_id) == ScriptVehicle::VT_RAIL && IsWagon(engine_id)) return -1;
|
||||
|
||||
return (int32_t)::Engine::Get(engine_id)->GetLifeLengthInDays();
|
||||
return ::Engine::Get(engine_id)->GetLifeLengthInDays().base();
|
||||
}
|
||||
|
||||
/* static */ Money ScriptEngine::GetRunningCost(EngineID engine_id)
|
||||
@@ -179,7 +179,7 @@
|
||||
{
|
||||
if (!IsValidEngine(engine_id)) return ScriptDate::DATE_INVALID;
|
||||
|
||||
return (ScriptDate::Date)(int32_t)::Engine::Get(engine_id)->intro_date;
|
||||
return (ScriptDate::Date)::Engine::Get(engine_id)->intro_date.base();
|
||||
}
|
||||
|
||||
/* static */ ScriptVehicle::VehicleType ScriptEngine::GetVehicleType(EngineID engine_id)
|
||||
|
Reference in New Issue
Block a user