Codechange: use std::string as script API return type

This commit is contained in:
Rubidium
2023-05-05 23:19:35 +02:00
committed by rubidium42
parent b24a6bb8f3
commit bbcb55ebc9
39 changed files with 83 additions and 83 deletions

View File

@@ -25,9 +25,9 @@
return ScriptCargo::HasCargoClass(cargo_type, ScriptCargo::CC_PASSENGERS) ? ROADVEHTYPE_BUS : ROADVEHTYPE_TRUCK;
}
/* static */ char *ScriptRoad::GetName(RoadType road_type)
/* static */ std::optional<std::string> ScriptRoad::GetName(RoadType road_type)
{
if (!IsRoadTypeAvailable(road_type)) return nullptr;
if (!IsRoadTypeAvailable(road_type)) return std::nullopt;
return GetString(GetRoadTypeInfo((::RoadType)road_type)->strings.name);
}