(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.

This commit is contained in:
rubidium 2009-09-07 23:30:31 +00:00
parent 2926611dd2
commit f40885ec50
3 changed files with 28 additions and 22 deletions

View File

@ -1,8 +1,19 @@
/* $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(subsidy_id)
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_id)
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(subsidy_id)
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(subsidy_id)
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);
}

View File

@ -1 +1,8 @@
/* $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/>.
*/

View File

@ -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