Update to 14.0-RC1

This commit is contained in:
dP
2024-02-19 04:42:45 +05:30
parent 910fa762b9
commit 53ff9d1f9f
183 changed files with 9531 additions and 5695 deletions
+1
View File
@@ -22,6 +22,7 @@
* \li AITown::ROAD_LAYOUT_RANDOM
* \li AIVehicle::IsPrimaryVehicle
* \li AITileList_StationCoverage
* \li AIAirport::GetAirportNumHelipads
*
* API removals:
* \li AIError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
+1
View File
@@ -88,6 +88,7 @@
* \li GSStoryPage::IsValidStoryPageButtonFlags
* \li GSStoryPage::IsValidStoryPageButtonCursor
* \li GSTileList_StationCoverage
* \li GSAirport::GetAirportNumHelipads
*
* API removals:
* \li GSError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
+7
View File
@@ -170,3 +170,10 @@
return (int64_t)GetMaintenanceCostFactor(type) * _price[PR_INFRASTRUCTURE_AIRPORT] >> 3;
}
/* static */ SQInteger ScriptAirport::GetAirportNumHelipads(AirportType type)
{
if (!IsAirportInformationAvailable(type)) return -1;
return ::AirportSpec::Get(type)->fsm->num_helipads;
}
+8
View File
@@ -207,6 +207,14 @@ public:
* @return Monthly maintenance cost of the airport type.
*/
static Money GetMonthlyMaintenanceCost(AirportType type);
/**
* Get the number of helipads of this airport type.
* @param type The airport type.
* @pre IsAirportInformationAvailable(type)
* @return Number of helipads of this type of airport. When 0 helicopters will go to normal terminals.
*/
static SQInteger GetAirportNumHelipads(AirportType type);
};
#endif /* SCRIPT_AIRPORT_HPP */
+4 -1
View File
@@ -111,7 +111,10 @@
/* static */ SQInteger ScriptGroup::GetNumEngines(GroupID group_id, EngineID engine_id)
{
EnforceCompanyModeValid(-1);
if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return -1;
if (!ScriptEngine::IsValidEngine(engine_id)) return -1;
bool valid_group = IsValidGroup(group_id);
if (!valid_group && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return -1;
if (valid_group && ScriptEngine::GetVehicleType(engine_id) != GetVehicleType(group_id)) return -1;
return GetGroupNumEngines(ScriptObject::GetCompany(), group_id, engine_id);
}
+3 -1
View File
@@ -128,7 +128,9 @@ public:
* Get the number of engines in a given group.
* @param group_id The group to get the number of engines in.
* @param engine_id The engine id to count.
* @pre IsValidGroup(group_id) || group_id == GROUP_ALL || group_id == GROUP_DEFAULT.
* @pre ScriptEngine::IsValidEngine(engine_id).
* @pre (IsValidGroup(group_id) && ScriptEngine::GetVehicleType(engine_id) == GetVehicleType(group_id)) ||
group_id == GROUP_ALL || group_id == GROUP_DEFAULT.
* @game @pre ScriptCompanyMode::IsValid().
* @return The number of engines with id engine_id in the group with id group_id.
*/