summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-07 23:30:31 +0000
committerrubidium <rubidium@openttd.org>2009-09-07 23:30:31 +0000
commitf40885ec506b080fe86e26b86155beb4ce45caaa (patch)
tree890e5c7b0095b09ea33c47c5eadd6cb21dfb3558
parent2926611dd27d8f57fabf9761b1c25f4944d5cce5 (diff)
downloadopenttd-f40885ec506b080fe86e26b86155beb4ce45caaa.tar.xz
(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.
-rw-r--r--bin/ai/compat_0.7.nut24
-rw-r--r--bin/ai/compat_0.8.nut7
-rw-r--r--src/ai/api/ai_changelog.hpp19
3 files changed, 28 insertions, 22 deletions
diff --git a/bin/ai/compat_0.7.nut b/bin/ai/compat_0.7.nut
index 377044326..1702f7963 100644
--- a/bin/ai/compat_0.7.nut
+++ b/bin/ai/compat_0.7.nut
@@ -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);
}
diff --git a/bin/ai/compat_0.8.nut b/bin/ai/compat_0.8.nut
index a0749a0c2..fe985b90d 100644
--- a/bin/ai/compat_0.8.nut
+++ b/bin/ai/compat_0.8.nut
@@ -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/>.
+ */
diff --git a/src/ai/api/ai_changelog.hpp b/src/ai/api/ai_changelog.hpp
index 6c14b7a2e..6fe23765f 100644
--- a/src/ai/api/ai_changelog.hpp
+++ b/src/ai/api/ai_changelog.hpp
@@ -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