@@ -9400,209 +9547,209 @@ ERROR: IsEnd() is invalid as Begin() is
17 => 10008
EngineType ListDump:
14 => 219
16 => 204
13 => 153
12 => 153
17 => 9
UnitNumber ListDump:
13 => 2
17 => 1
16 => 1
14 => 1
12 => 1
Age ListDump:
12 => 1
17 => 0
16 => 0
14 => 0
13 => 0
MaxAge ListDump:
16 => 10980
14 => 10980
17 => 7320
13 => 5490
12 => 5490
AgeLeft ListDump:
16 => 10980
14 => 10980
17 => 7320
13 => 5490
12 => 5489
CurrentSpeed ListDump:
12 => 27
17 => 0
16 => 0
14 => 0
13 => 0
RunningCost ListDump:
14 => 2756
17 => 2296
16 => 2296
13 => 421
12 => 421
ProfitThisYear ListDump:
17 => 0
16 => 0
14 => 0
13 => 0
12 => -1
ProfitLastYear ListDump:
17 => 0
16 => 0
14 => 0
13 => 0
12 => 0
CurrentValue ListDump:
14 => 30761
16 => 30468
17 => 22265
13 => 5947
12 => 5947
VehicleType ListDump:
14 => 3
16 => 2
13 => 1
12 => 1
17 => 0
RoadType ListDump:
13 => 0
12 => 0
17 => -1
16 => -1
14 => -1
VehicleType ListDump:
13 => 12
12 => 12
17 => 0
16 => 0
14 => 0
VehicleType ListDump:
17 => 0
16 => 0
14 => 0
13 => 0
12 => 0
--Order--
GetOrderCount(): 0
GetOrderDestination(): -1
AreOrderFlagsValid(): true
AreOrderFlagsValid(): false
AreOrderFlagsValid(): true
AreOrderFlagsValid(): true
AreOrderFlagsValid(): true
AreOrderFlagsValid(): true
IsValidConditionalOrder(): true
IsValidConditionalOrder(): false
IsValidConditionalOrder(): true
IsValidConditionalOrder(): false
IsValidVehicleOrder(): false
IsGotoStationOrder(): false
IsGotoDepotOrder(): false
IsGotoWaypointOrder(): false
IsConditionalOrder(): false
IsCurrentOrderPartOfOrderList(): false
GetOrderFlags(): 65535
AppendOrder(): true
InsertOrder(): true
GetOrderCount(): 2
IsValidVehicleOrder(): true
IsGotoStationOrder(): true
IsGotoDepotOrder(): false
IsGotoWaypointOrder(): false
IsConditionalOrder(): false
IsCurrentOrderPartOfOrderList(): false
GetOrderFlags(): 8
GetOrderFlags(): 8
GetOrderJumpTo(): -1
RemoveOrder(): true
SetOrderFlags(): true
GetOrderFlags(): 64
GetOrderDestination(): 33411
CopyOrders(): false
CopyOrders(): true
ShareOrders(): false
ShareOrders(): true
UnshareOrders(): true
AppendOrder(): true
GetStopLocation(): -1
BuildVehicle(): 20
BuildRailStation(): true
AppendOrder(): true
GetOrderCount(): 1
GetStopLocation(): 2
SetStopLocation(): true
GetStopLocation(): 1
--VehicleList_Station--
Count(): 1
Location ListDump:
20 => 23596
foreach():
20 => 23596
First Subsidy Test
--Subsidy (0) --
IsValidSubsidy(): true
IsAwarded(): false
GetAwardedTo(): -1
GetExpireDate(): 714080
GetSourceType(): 1
GetSourceIndex(): 15
GetDestinationType(): 1
GetDestinationIndex(): 7
GetCargoType(): 0
IsEventWaiting: false
--Math--
-2147483648 < -2147483647: true
-2147483648 < -1 : true
-2147483648 < 0 : true
-2147483648 < 1 : true
-2147483648 < 2147483647: true
-2147483647 < -2147483648: false
-1 < -2147483648: false
0 < -2147483648: false
1 < -2147483648: false
2147483647 < -2147483648: false
-1 > 2147483647: false
-1 > 1 : false
-1 > 0 : false
-1 > -1 : false
-1 > -2147483648: true
1 > 2147483647: false
1 > 1 : false
1 > 0 : true
1 > -1 : true
1 > -2147483648: true
2147483647 > 2147483646: true
2147483647 > 1 : true
2147483647 > 0 : true
2147483647 > -1 : true
2147483647 > -2147483648: true
2147483646 > 2147483647: false
1 > 2147483647: false
0 > 2147483647: false
-1 > 2147483647: false
-2147483648 > 2147483647: false
13725 > -2147483648: true
--Valuate() with excessive CPU usage--
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [unknown()] regression/main.nut line [2034]
*FUNCTION [unknown()] regression/main.nut line [2050]
*FUNCTION [Valuate()] NATIVE line [-1]
*FUNCTION [Start()] regression/main.nut line [2035]
*FUNCTION [Start()] regression/main.nut line [2051]
[id] 0
[this] TABLE
[Infinite] CLOSURE
[list] INSTANCE
[this] INSTANCE
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [Start()] regression/main.nut line [2035]
*FUNCTION [Start()] regression/main.nut line [2051]
[Infinite] CLOSURE
[list] INSTANCE
[this] INSTANCE
ERROR: The script died unexpectedly.
src/script/api/ai_changelog.hpp
➞
Show inline comments
/*
* 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/>.
*/
/**
* @file ai_changelog.hpp Lists all changes / additions to the API.
*
* Only new / renamed / deleted api functions will be listed here. A list of
* bug fixes can be found in the normal changelog. Note that removed API
* functions may still be available if you return an older API version
* in GetAPIVersion() in info.nut.
*
* \b 14.0
*
* This version is not yet released. The following changes are not set in stone yet.
*
* API additions:
* \li AITimeMode
* \li AITown::ROAD_LAYOUT_RANDOM
* \li AIVehicle::IsPrimaryVehicle
* \li AITileList_StationCoverage
*
* API removals:
* \li AIError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
* \li AIInfo::CONFIG_RANDOM, no longer used.
*
* Other changes:
* \li AIGroupList accepts an optional filter function
* \li AIIndustryList accepts an optional filter function
* \li AISignList accepts an optional filter function
* \li AISubsidyList accepts an optional filter function
* \li AITownList accepts an optional filter function
* \li AIVehicleList accepts an optional filter function
* \li AIInfo::AddSettings easy_value / medium_value / hard_value are replaced with default_value
*
* \b 13.0
*
* API additions:
* \li AICargo::GetWeight
* \li AIIndustryType::ResolveNewGRFID
* \li AIObjectType::ResolveNewGRFID
*
* Other changes:
* \li AIRoad::HasRoadType now correctly checks RoadType against RoadType
*
* \b 12.0
*
* API additions:
* \li AINewGRF
* \li AINewGRFList
* \li AIGroup::GetNumVehicles
* \li AIMarine::BT_LOCK
* \li AIMarine::BT_CANAL
* \li AITile::IsSeaTile
* \li AITile::IsRiverTile
* \li AITile::BT_CLEAR_WATER
* \li AIObjectTypeList
* \li AIObjectType
*
* \b 1.11.0
*
* API additions:
* \li AICargo::GetName
* \li AIPriorityQueue
*
* Other changes:
* \li AIVehicle::CloneVehicle now correctly returns estimate when short on cash
*
* \b 1.10.0
*
* API additions:
* \li AIGroup::SetPrimaryColour
* \li AIGroup::SetSecondaryColour
* \li AIGroup::GetPrimaryColour
* \li AIGroup::GetSecondaryColour
* \li AIVehicle::BuildVehicleWithRefit
* \li AIVehicle::GetBuildWithRefitCapacity
* \li AIRoad::GetName
* \li AIRoad::RoadVehCanRunOnRoad
* \li AIRoad::RoadVehHasPowerOnRoad
* \li AIRoad::ConvertRoadType
* \li AIRoad::GetMaxSpeed
* \li AIEngine::CanRunOnRoad
* \li AIEngine::HasPowerOnRoad
* \li AIRoadTypeList::RoadTypeList
* \li AIEventVehicleAutoReplaced
*
* Other changes:
* \li AITile::DemolishTile works without a selected company
*
* \b 1.9.0
*
* API additions:
* \li AIAirport::GetMonthlyMaintenanceCost
* \li AIGroup::SetParent
* \li AIGroup::GetParent
* \li AICompany::SetPrimaryLiveryColour
* \li AICompany::SetSecondaryLiveryColour
* \li AICompany::GetPrimaryLiveryColour
* \li AICompany::GetSecondaryLiveryColour
*
* Other changes:
* \li AIBridge::GetName takes one extra parameter to refer the vehicle type
* 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/>.
*/
/**
* @file game_changelog.hpp Lists all changes / additions to the API.
*
* Only new / renamed / deleted api functions will be listed here. A list of
* bug fixes can be found in the normal changelog. Note that removed API
* functions may still be available if you return an older API version
* in GetAPIVersion() in info.nut.
*
* \b 14.0
*
* This version is not yet released. The following changes are not set in stone yet.
*
* API additions:
* \li GSIndustry::GetConstructionDate
* \li GSAsyncMode
* \li GSCompanyMode::IsValid
* \li GSCompanyMode::IsDeity
* \li GSTimeMode
* \li GSTown::ROAD_LAYOUT_RANDOM
* \li GSVehicle::IsPrimaryVehicle
* \li GSOrder::SetOrderJumpTo
* \li GSOrder::SetOrderCondition
* \li GSOrder::SetOrderCompareFunction
* \li GSOrder::SetOrderCompareValue
* \li GSOrder::SetStopLocation
* \li GSOrder::SetOrderRefit
* \li GSOrder::AppendOrder
* \li GSOrder::AppendConditionalOrder
* \li GSOrder::InsertOrder
* \li GSOrder::InsertConditionalOrder
* \li GSOrder::RemoveOrder
* \li GSOrder::SetOrderFlags
* \li GSOrder::MoveOrder
* \li GSOrder::SkipToOrder
* \li GSOrder::CopyOrders
* \li GSOrder::ShareOrders
* \li GSOrder::UnshareOrders
* \li GSCompany::IsMine
* \li GSCompany::SetPresidentGender
* \li GSCompany::SetAutoRenewStatus
* \li GSCompany::SetAutoRenewMonths
* \li GSCompany::SetAutoRenewMoney
* \li GSCompany::SetMaxLoanAmountForCompany
* \li GSCompany::ResetMaxLoanAmountForCompany
* \li GSGameSettings::IsDisabledVehicleType
* \li GSGroup::GroupID
* \li GSGroup::IsValidGroup
* \li GSGroup::CreateGroup
* \li GSGroup::DeleteGroup
* \li GSGroup::GetVehicleType
* \li GSGroup::SetName
* \li GSGroup::GetName
* \li GSGroup::SetParent
* \li GSGroup::GetParent
* \li GSGroup::EnableAutoReplaceProtection
* \li GSGroup::GetAutoReplaceProtection
* \li GSGroup::GetNumEngines
* \li GSGroup::GetNumVehicles
* \li GSGroup::MoveVehicle
* \li GSGroup::EnableWagonRemoval
* \li GSGroup::HasWagonRemoval
* \li GSGroup::SetAutoReplace
* \li GSGroup::GetEngineReplacement
* \li GSGroup::StopAutoReplace
* \li GSGroup::GetProfitThisYear
* \li GSGroup::GetProfitLastYear
* \li GSGroup::GetCurrentUsage
* \li GSGroup::SetPrimaryColour
* \li GSGroup::SetSecondaryColour
* \li GSGroup::GetPrimaryColour
* \li GSGroup::GetSecondaryColour
* \li GSGroupList
* \li GSVehicleList_Group
* \li GSVehicleList_DefaultGroup
* \li GSGoal::IsValidGoalDestination
* \li GSGoal::SetDestination
* \li GSIndustry::GetProductionLevel
* \li GSIndustry::SetProductionLevel
* \li GSStoryPage::IsValidStoryPageElementType
* \li GSStoryPage::IsValidStoryPageButtonColour
* \li GSStoryPage::IsValidStoryPageButtonFlags
* \li GSStoryPage::IsValidStoryPageButtonCursor
* \li GSTileList_StationCoverage
*
* API removals:
* \li GSError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
* \li AIInfo::CONFIG_RANDOM, no longer used.
* \li GSInfo::CONFIG_RANDOM, no longer used.
*
* Other changes:
* \li GSGroupList accepts an optional filter function
* \li GSIndustryList accepts an optional filter function
* \li GSSignList accepts an optional filter function
* \li GSSubsidyList accepts an optional filter function
* \li GSTownList accepts an optional filter function
* \li GSVehicleList accepts an optional filter function
* \li GSInfo::AddSettings easy_value / medium_value / hard_value are replaced with default_value
*
* \b 13.0
*
* API additions:
* \li GSCargo::GetWeight
* \li GSIndustryType::ResolveNewGRFID
* \li GSObjectType::ResolveNewGRFID
* \li GSLeagueTable
*
* Other changes:
* \li GSRoad::HasRoadType now correctly checks RoadType against RoadType
*
* \b 12.0
*
* API additions:
* \li GSNewGRF
* \li GSNewGRFList
* \li GSMarine::BT_LOCK
* \li GSMarine::BT_CANAL
* \li GSTile::IsSeaTile
* \li GSTile::IsRiverTile
* \li GSTile::BT_CLEAR_WATER
* \li GSObjectTypeList
* \li GSObjectType
*
* \b 1.11.0
*
* API additions:
* \li GSCargo::GetName
* \li GSEventStoryPageButtonClick
* \li GSEventStoryPageTileSelect
* \li GSEventStoryPageVehicleSelect
* \li GSIndustry::GetCargoLastAcceptedDate
* \li GSIndustry::GetControlFlags
* \li GSIndustry::GetExclusiveConsumer
* \li GSIndustry::GetExclusiveSupplier
* \li GSIndustry::GetLastProductionYear
* \li GSIndustry::SetControlFlags
* \li GSIndustry::SetExclusiveConsumer
* \li GSIndustry::SetExclusiveSupplier
* \li GSIndustry::SetText
* \li GSStoryPage::MakePushButtonReference
* \li GSStoryPage::MakeTileButtonReference
* \li GSStoryPage::MakeVehicleButtonReference
* \li GSPriorityQueue
*
* Other changes:
* \li GSCompany::ChangeBankBalance takes one extra parameter to refer to a location to show text effect on
* \li GSGoal::Question and GSGoal::QuestionClient no longer require to have any buttons except for the window type GSGoal.QT_QUESTION
*
* \b 1.10.0
*
* API additions:
* \li GSVehicle::BuildVehicleWithRefit
* \li GSVehicle::GetBuildWithRefitCapacity
* \li GSRoad::GetName
* \li GSRoad::RoadVehCanRunOnRoad
* \li GSRoad::RoadVehHasPowerOnRoad
* \li GSRoad::ConvertRoadType
* \li GSRoad::GetMaxSpeed
* \li GSEngine::EnableForCompany
* \li GSEngine::DisableForCompany
*
* \b 1.9.0
*
* API additions:
* \li GSAirport::GetMonthlyMaintenanceCost
* \li GSClient
* \li GSClientList
* \li GSClientList_Company
* \li GSViewport::ScrollEveryoneTo
* \li GSViewport::ScrollCompanyClientsTo
* \li GSViewport::ScrollClientTo
* \li GSGoal::QuestionClient
*
* Other changes:
* \li GSBridge::GetName takes one extra parameter to refer the vehicle type
*
* \b 1.8.0
*
* No changes
*
* API additions:
* \li GSRoad::ERR_ROADTYPE_DISALLOWS_CROSSING
*
* \b 1.7.0 - 1.7.2
*
* No changes
*
* \b 1.6.1 - 1.6.0
*
* No changes
*
* \b 1.5.3 - 1.5.1
*
* No changes
*
* \b 1.5.0
*
* API additions:
* \li GSList::SwapList
* \li GSStation::GetCargoPlanned
* \li GSStation::GetCargoPlannedFrom
* \li GSStation::GetCargoPlannedFromVia
* \li GSStation::GetCargoPlannedVia
* \li GSStation::GetCargoWaitingFromVia
* \li GSStationList_CargoPlannedByFrom
* \li GSStationList_CargoPlannedByVia
* \li GSStationList_CargoPlannedFromByVia
* \li GSStationList_CargoPlannedViaByFrom
* \li GSStationList_CargoWaitingByFrom
* \li GSStationList_CargoWaitingByVia
* \li GSStationList_CargoWaitingFromByVia
* \li GSStationList_CargoWaitingViaByFrom
*
* Other changes:
* \li GSNews::Create takes two extra parameters to refer to a location, station,
* industry, or town. The user can click at the news message to jump to the
* referred location.
*
* \b 1.4.4 - 1.4.3
*
* No changes
*
* \b 1.4.2
*
* Other changes:
* \li GSCargoMonitor delivery and pickup monitor functions have improved boundary checking for
* their parameters, and return \c -1 if they are found out of bounds.
*
* \b 1.4.1
*
* No changes
*
* \b 1.4.0
*
* API additions:
* \li AICargo::GetDistributionType
* \li GSCompany::ChangeBankBalance
* \li GSDate::DATE_INVALID
* \li GSDate::IsValidDate
* \li GSGoal::GT_STORY_PAGE
* \li GSGoal::IsCompleted
* \li GSGoal::SetCompleted
* \li GSGoal::SetProgress
* \li GSGoal::SetText
* \li GSStation::HasCargoRating
* \li GSStation::GetCargoWaitingFrom
* \li GSStation::GetCargoWaitingVia
* \li GSStoryPage
* \li GSStoryPageList
* \li GSStoryPageElementList
* \li GSTile::GetTerrainType
* \li GSTown::FoundTown
* \li GSTown::GetFundBuildingsDuration
* \li GSTown::SetName
* \li GSTown::TOWN_GROWTH_NONE
* \li GSTown::TOWN_GROWTH_NORMAL
*
* Other changes:
* \li GSGoal::New can now create up to 64000 concurrent goals. The old limit was 256 goals.
* \li GSStation::GetCargoRating does return -1 for cargo-station combinations that
* do not have a rating yet instead of returning 69.
*
* \b 1.3.3 - 1.3.2
*
* No changes
*
* \b 1.3.1
*
* API additions:
* \li GSTile::GetTerrainType
*
* \b 1.3.0
*
* API additions:
* \li GSCargoMonitor
* \li GSEngine::IsValidEngine and GSEngine::IsBuildable when outside GSCompanyMode scope
* 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/>.
*/
/** @file script_tilelist.cpp Implementation of ScriptTileList and friends. */
* 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/>.
*/
/** @file script_tilelist.hpp List tiles. */
#ifndef SCRIPT_TILELIST_HPP
#define SCRIPT_TILELIST_HPP
#include "script_station.hpp"
#include "script_list.hpp"
/**
* Creates an empty list, in which you can add tiles.
* @api ai game
* @ingroup ScriptList
*/
class ScriptTileList : public ScriptList {
public:
/**
* Adds the rectangle between tile_from and tile_to to the to-be-evaluated tiles.
* @param tile_from One corner of the tiles to add.
* @param tile_to The other corner of the tiles to add.