Changeset - r12965:71b3aafd8d14
[Not reviewed]
master
0 3 0
rubidium - 15 years ago 2009-09-07 23:30:31
rubidium@openttd.org
(svn r17469) -Change: make the AI compatability wrapper not whine about deprecation (yet), but make it clear that the wrapper is running and what (slight) changes there are w.r.t. to 0.7.
3 files changed with 28 insertions and 22 deletions:
0 comments (0 inline, 0 general)
bin/ai/compat_0.7.nut
Show inline comments
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("0.7 API compatability in effect:");
 
AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
 
AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
 
AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies.");
 

	
 
AISign.GetMaxSignID <- function()
 
{
 
	AILog.Warning("AISign::GetMaxSignID is deprecated and will be removed soon, please use AISignList instead.");
 
	local list = AISignList();
 
	local max_id = 0;
 
	foreach (id, d in list) {
 
@@ -13,7 +24,6 @@ AISign.GetMaxSignID <- function()
 

	
 
AITile.GetHeight <- function(tile)
 
{
 
	AILog.Warning("AITile::GetHeight is deprecated and will be removed soon, please use GetMinHeight/GetMaxHeight/GetCornerHeight instead.");
 
	if (!AIMap.IsValidTile(tile)) return -1;
 

	
 
	return AITile.GetCornerHeight(tile, AITile.CORNER_N);
 
@@ -21,8 +31,6 @@ AITile.GetHeight <- function(tile)
 

	
 
AIOrder.ChangeOrder <- function(vehicle_id, order_position, order_flags)
 
{
 
	AILog.Warning("AIOrder::ChangeOrder is deprecated and will be removed soon, please use AIOrder::SetOrderFlags instead.")
 

	
 
	return AIOrder.SetOrderFlags(vehicle_id, order_position, order_flags);
 
}
 

	
 
@@ -30,7 +38,6 @@ AIWaypoint.WAYPOINT_INVALID <- 0xFFFF;
 

	
 
AISubsidy.SourceIsTown <- function(subsidy_id)
 
{
 
	AILog.Warning("AISubsidy::SourceIsTown is deprecated and will be removed soon, please use AISubsidy::GetSourceType instead.");
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
 

	
 
	return AISubsidy.GetSourceType(subsidy_id) == AISubsidy.SPT_TOWN;
 
@@ -38,11 +45,9 @@ AISubsidy.SourceIsTown <- function(subsi
 

	
 
AISubsidy.GetSource <- function(subsidy_id)
 
{
 
	AILog.Warning("AISubsidy::GetSource is deprecated and will be removed soon, please use AISubsidy::GetSourceIndex instead.");
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
 

	
 
	if (AISubsidy.IsAwarded(subsidy_id)) {
 
		AILog.Error("AISubsidy::GetSource returned STATION_INVALID due to internal changes in the Subsidy logic.");
 
		return AIBaseStation.STATION_INVALID;
 
	}
 

	
 
@@ -51,7 +56,6 @@ AISubsidy.GetSource <- function(subsidy_
 

	
 
AISubsidy.DestinationIsTown <- function(subsidy_id)
 
{
 
	AILog.Warning("AISubsidy::DestinationIsTown is deprecated and will be removed soon, please use AISubsidy::GetDestinationType instead.");
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
 

	
 
	return AISubsidy.GetDestinationType(subsidy_id) == AISubsidy.SPT_TOWN;
 
@@ -59,11 +63,9 @@ AISubsidy.DestinationIsTown <- function(
 

	
 
AISubsidy.GetDestination <- function(subsidy_id)
 
{
 
	AILog.Warning("AISubsidy::GetDestination is deprecated and will be removed soon, please use AISubsidy::GetDestinationIndex instead.");
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
 

	
 
	if (AISubsidy.IsAwarded(subsidy_id)) {
 
		AILog.Error("AISubsidy::GetDestination returned STATION_INVALID due to internal changes in the Subsidy logic.");
 
		return AIBaseStation.STATION_INVALID;
 
	}
 

	
 
@@ -72,7 +74,5 @@ AISubsidy.GetDestination <- function(sub
 

	
 
AITown.GetMaxProduction <- function(town_id, cargo_id)
 
{
 
	AILog.Warning("AITown::GetMaxProduction is deprecated and will be removed soon, please use AITown::GetLastMonthProduction instead.");
 
	AILog.Warning("Also note that behaviour of AITown::GetLastMonthProduction has slightly changed.");
 
	return AITown.GetLastMonthProduction(town_id, cargo_id);
 
}
bin/ai/compat_0.8.nut
Show inline comments
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
src/ai/api/ai_changelog.hpp
Show inline comments
 
@@ -30,16 +30,15 @@
 
 * \li AIIndustry::GetLastMonthTransportedPercentage
 
 *
 
 * API removals:
 
 * \li AIOrder::ChangeOrder
 
 * \li AISign::GetMaxSignID
 
 * \li AITile::GetHeight
 
 * \li AIBaseStation::WAYPOINT_INVALID
 
 * \li AISubsidy::SourceIsTown
 
 * \li AISubsidy::GetSource
 
 * \li AISubsidy::DestinationIsTown
 
 * \li AISubsidy::GetDestination
 
 * \li AITown::GetMaxProduction
 
 * \li AIWaypoint::WAYPOINT_INVALID
 
 * \li AIOrder::ChangeOrder, use AIOrder::SetOrderFlags instead
 
 * \li AISign::GetMaxSignID, use AISignList instead
 
 * \li AITile::GetHeight, use AITile::GetMinHeight/GetMaxHeight/GetCornerHeight instead
 
 * \li AISubsidy::SourceIsTown, use AISubsidy::GetSourceType instead
 
 * \li AISubsidy::GetSource, use AISubsidy::GetSourceIndex instead
 
 * \li AISubsidy::DestinationIsTown, use AISubsidy::GetDestinationType instead
 
 * \li AISubsidy::GetDestination, use AISubsidy::GetDestinationIndex instead
 
 * \li AITown::GetMaxProduction, use AITown::GetLastMonthProduction instead
 
 * \li AIWaypoint::WAYPOINT_INVALID, use AIBaseStation::STATION_INVALID instead
 
 *
 
 * Other changes:
 
 * \li The GetName / SetName / GetLocation functions were moved from AIStation
0 comments (0 inline, 0 general)