summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 21:05:36 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 21:05:36 +0000
commit9b6b2cabc187f3cb72a53d396418ab1b9ebd2933 (patch)
treeac5d34e3837adcdf45c69ab844bd823dc740900a /src
parentcc3f42794d134b9f4b6c7efecb07d4b3366887c1 (diff)
downloadopenttd-9b6b2cabc187f3cb72a53d396418ab1b9ebd2933.tar.xz
(svn r23633) -Add: allow most build commands from GameScript given a CompanyMode is active in that scope
Diffstat (limited to 'src')
-rw-r--r--src/script/api/doxygen_filter.awk4
-rw-r--r--src/script/api/game/game_airport.hpp.sq2
-rw-r--r--src/script/api/game/game_basestation.hpp.sq1
-rw-r--r--src/script/api/game/game_bridge.hpp.sq1
-rw-r--r--src/script/api/game/game_company.hpp.sq3
-rw-r--r--src/script/api/game/game_industrytype.hpp.sq2
-rw-r--r--src/script/api/game/game_marine.hpp.sq10
-rw-r--r--src/script/api/game/game_rail.hpp.sq53
-rw-r--r--src/script/api/game/game_road.hpp.sq46
-rw-r--r--src/script/api/game/game_tile.hpp.sq6
-rw-r--r--src/script/api/game/game_town.hpp.sq42
-rw-r--r--src/script/api/game/game_tunnel.hpp.sq1
-rw-r--r--src/script/api/game/game_vehicle.hpp.sq75
-rw-r--r--src/script/api/script_airport.cpp2
-rw-r--r--src/script/api/script_airport.hpp4
-rw-r--r--src/script/api/script_basestation.cpp1
-rw-r--r--src/script/api/script_basestation.hpp2
-rw-r--r--src/script/api/script_bridge.cpp1
-rw-r--r--src/script/api/script_bridge.hpp2
-rw-r--r--src/script/api/script_company.cpp3
-rw-r--r--src/script/api/script_company.hpp6
-rw-r--r--src/script/api/script_industrytype.cpp2
-rw-r--r--src/script/api/script_industrytype.hpp4
-rw-r--r--src/script/api/script_marine.cpp10
-rw-r--r--src/script/api/script_marine.hpp20
-rw-r--r--src/script/api/script_rail.cpp13
-rw-r--r--src/script/api/script_rail.hpp26
-rw-r--r--src/script/api/script_road.cpp8
-rw-r--r--src/script/api/script_road.hpp22
-rw-r--r--src/script/api/script_tile.cpp6
-rw-r--r--src/script/api/script_tile.hpp12
-rw-r--r--src/script/api/script_town.cpp5
-rw-r--r--src/script/api/script_town.hpp9
-rw-r--r--src/script/api/script_tunnel.cpp1
-rw-r--r--src/script/api/script_tunnel.hpp2
-rw-r--r--src/script/api/script_vehicle.cpp11
-rw-r--r--src/script/api/script_vehicle.hpp26
37 files changed, 292 insertions, 152 deletions
diff --git a/src/script/api/doxygen_filter.awk b/src/script/api/doxygen_filter.awk
index f699756da..bf03aa0f8 100644
--- a/src/script/api/doxygen_filter.awk
+++ b/src/script/api/doxygen_filter.awk
@@ -144,6 +144,10 @@ BEGIN {
{
if (comment == "true" && !match($0, /@api/))
{
+ if (match($0, /@game /) && api != "GS") next;
+ if (match($0, /@ai /) && api != "AI") next;
+ gsub("@game ", "", $0);
+ gsub("@ai ", "", $0);
comment_buffer = comment_buffer $0 "\n"; next;
}
}
diff --git a/src/script/api/game/game_airport.hpp.sq b/src/script/api/game/game_airport.hpp.sq
index fe4d993e8..cfa99ba37 100644
--- a/src/script/api/game/game_airport.hpp.sq
+++ b/src/script/api/game/game_airport.hpp.sq
@@ -46,6 +46,8 @@ void SQGSAirport_Register(Squirrel *engine)
SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::GetAirportCoverageRadius, "GetAirportCoverageRadius", 2, ".i");
SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::GetNumHangars, "GetNumHangars", 2, ".i");
SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::GetHangarOfAirport, "GetHangarOfAirport", 2, ".i");
+ SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::BuildAirport, "BuildAirport", 4, ".iii");
+ SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::RemoveAirport, "RemoveAirport", 2, ".i");
SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::GetAirportType, "GetAirportType", 2, ".i");
SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::GetNoiseLevelIncrease, "GetNoiseLevelIncrease", 3, ".ii");
SQGSAirport.DefSQStaticMethod(engine, &ScriptAirport::GetNearestTown, "GetNearestTown", 3, ".ii");
diff --git a/src/script/api/game/game_basestation.hpp.sq b/src/script/api/game/game_basestation.hpp.sq
index d20b4c739..f1e1797e9 100644
--- a/src/script/api/game/game_basestation.hpp.sq
+++ b/src/script/api/game/game_basestation.hpp.sq
@@ -27,6 +27,7 @@ void SQGSBaseStation_Register(Squirrel *engine)
SQGSBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::IsValidBaseStation, "IsValidBaseStation", 2, ".i");
SQGSBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetName, "GetName", 2, ".i");
+ SQGSBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::SetName, "SetName", 3, ".i.");
SQGSBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetLocation, "GetLocation", 2, ".i");
SQGSBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetConstructionDate, "GetConstructionDate", 2, ".i");
diff --git a/src/script/api/game/game_bridge.hpp.sq b/src/script/api/game/game_bridge.hpp.sq
index 56b327471..029a3ab3d 100644
--- a/src/script/api/game/game_bridge.hpp.sq
+++ b/src/script/api/game/game_bridge.hpp.sq
@@ -43,6 +43,7 @@ void SQGSBridge_Register(Squirrel *engine)
SQGSBridge.DefSQStaticMethod(engine, &ScriptBridge::GetMaxLength, "GetMaxLength", 2, ".i");
SQGSBridge.DefSQStaticMethod(engine, &ScriptBridge::GetMinLength, "GetMinLength", 2, ".i");
SQGSBridge.DefSQStaticMethod(engine, &ScriptBridge::BuildBridge, "BuildBridge", 5, ".iiii");
+ SQGSBridge.DefSQStaticMethod(engine, &ScriptBridge::RemoveBridge, "RemoveBridge", 2, ".i");
SQGSBridge.DefSQStaticMethod(engine, &ScriptBridge::GetOtherBridgeEnd, "GetOtherBridgeEnd", 2, ".i");
SQGSBridge.PostRegister(engine);
diff --git a/src/script/api/game/game_company.hpp.sq b/src/script/api/game/game_company.hpp.sq
index 957d68355..e90b1a8a4 100644
--- a/src/script/api/game/game_company.hpp.sq
+++ b/src/script/api/game/game_company.hpp.sq
@@ -35,6 +35,8 @@ void SQGSCompany_Register(Squirrel *engine)
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetName, "GetName", 2, ".i");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetPresidentName, "GetPresidentName", 2, ".i");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetPresidentGender, "GetPresidentGender", 2, ".i");
+ SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::SetLoanAmount, "SetLoanAmount", 2, ".i");
+ SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::SetMinimumLoanAmount, "SetMinimumLoanAmount", 2, ".i");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetLoanAmount, "GetLoanAmount", 1, ".");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetMaxLoanAmount, "GetMaxLoanAmount", 1, ".");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetLoanInterval, "GetLoanInterval", 1, ".");
@@ -44,6 +46,7 @@ void SQGSCompany_Register(Squirrel *engine)
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyCargoDelivered, "GetQuarterlyCargoDelivered", 3, ".ii");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyPerformanceRating, "GetQuarterlyPerformanceRating", 3, ".ii");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyCompanyValue, "GetQuarterlyCompanyValue", 3, ".ii");
+ SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::BuildCompanyHQ, "BuildCompanyHQ", 2, ".i");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetCompanyHQ, "GetCompanyHQ", 2, ".i");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewStatus, "GetAutoRenewStatus", 2, ".i");
SQGSCompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewMonths, "GetAutoRenewMonths", 2, ".i");
diff --git a/src/script/api/game/game_industrytype.hpp.sq b/src/script/api/game/game_industrytype.hpp.sq
index 537411ec1..66425a512 100644
--- a/src/script/api/game/game_industrytype.hpp.sq
+++ b/src/script/api/game/game_industrytype.hpp.sq
@@ -33,6 +33,8 @@ void SQGSIndustryType_Register(Squirrel *engine)
SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::GetConstructionCost, "GetConstructionCost", 2, ".i");
SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::CanBuildIndustry, "CanBuildIndustry", 2, ".i");
SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::CanProspectIndustry, "CanProspectIndustry", 2, ".i");
+ SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::BuildIndustry, "BuildIndustry", 3, ".ii");
+ SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::ProspectIndustry, "ProspectIndustry", 2, ".i");
SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::IsBuiltOnWater, "IsBuiltOnWater", 2, ".i");
SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::HasHeliport, "HasHeliport", 2, ".i");
SQGSIndustryType.DefSQStaticMethod(engine, &ScriptIndustryType::HasDock, "HasDock", 2, ".i");
diff --git a/src/script/api/game/game_marine.hpp.sq b/src/script/api/game/game_marine.hpp.sq
index 76d7032f2..0da851320 100644
--- a/src/script/api/game/game_marine.hpp.sq
+++ b/src/script/api/game/game_marine.hpp.sq
@@ -37,6 +37,16 @@ void SQGSMarine_Register(Squirrel *engine)
SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::IsLockTile, "IsLockTile", 2, ".i");
SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::IsCanalTile, "IsCanalTile", 2, ".i");
SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::AreWaterTilesConnected, "AreWaterTilesConnected", 3, ".ii");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::BuildWaterDepot, "BuildWaterDepot", 3, ".ii");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::BuildDock, "BuildDock", 3, ".ii");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::BuildBuoy, "BuildBuoy", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::BuildLock, "BuildLock", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::BuildCanal, "BuildCanal", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::RemoveWaterDepot, "RemoveWaterDepot", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::RemoveDock, "RemoveDock", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::RemoveBuoy, "RemoveBuoy", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::RemoveLock, "RemoveLock", 2, ".i");
+ SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::RemoveCanal, "RemoveCanal", 2, ".i");
SQGSMarine.DefSQStaticMethod(engine, &ScriptMarine::GetBuildCost, "GetBuildCost", 2, ".i");
SQGSMarine.PostRegister(engine);
diff --git a/src/script/api/game/game_rail.hpp.sq b/src/script/api/game/game_rail.hpp.sq
index ea900f448..68c8b3322 100644
--- a/src/script/api/game/game_rail.hpp.sq
+++ b/src/script/api/game/game_rail.hpp.sq
@@ -59,26 +59,39 @@ void SQGSRail_Register(Squirrel *engine)
ScriptError::RegisterErrorMapString(ScriptRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
ScriptError::RegisterErrorMapString(ScriptRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetName, "GetName", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailTile, "IsRailTile", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsLevelCrossingTile, "IsLevelCrossingTile", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailDepotTile, "IsRailDepotTile", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailStationTile, "IsRailStationTile", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailWaypointTile, "IsRailWaypointTile", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailTypeAvailable, "IsRailTypeAvailable", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetCurrentRailType, "GetCurrentRailType", 1, ".");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::SetCurrentRailType, "SetCurrentRailType", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::TrainCanRunOnRail, "TrainCanRunOnRail", 3, ".ii");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::TrainHasPowerOnRail, "TrainHasPowerOnRail", 3, ".ii");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailType, "GetRailType", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailDepotFrontTile, "GetRailDepotFrontTile", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailStationDirection, "GetRailStationDirection", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailTracks, "GetRailTracks", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::AreTilesConnected, "AreTilesConnected", 4, ".iii");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetSignalType, "GetSignalType", 3, ".ii");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetBuildCost, "GetBuildCost", 3, ".ii");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetMaxSpeed, "GetMaxSpeed", 2, ".i");
- SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetMaintenanceCostFactor, "GetMaintenanceCostFactor", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetName, "GetName", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailTile, "IsRailTile", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsLevelCrossingTile, "IsLevelCrossingTile", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailDepotTile, "IsRailDepotTile", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailStationTile, "IsRailStationTile", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailWaypointTile, "IsRailWaypointTile", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailTypeAvailable, "IsRailTypeAvailable", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetCurrentRailType, "GetCurrentRailType", 1, ".");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::SetCurrentRailType, "SetCurrentRailType", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::TrainCanRunOnRail, "TrainCanRunOnRail", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::TrainHasPowerOnRail, "TrainHasPowerOnRail", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailType, "GetRailType", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::ConvertRailType, "ConvertRailType", 4, ".iii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailDepotFrontTile, "GetRailDepotFrontTile", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailStationDirection, "GetRailStationDirection", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailDepot, "BuildRailDepot", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailStation, "BuildRailStation", 6, ".iiiii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildNewGRFRailStation, "BuildNewGRFRailStation", 11, ".iiiiiiiiib");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailWaypoint, "BuildRailWaypoint", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRailWaypointTileRectangle, "RemoveRailWaypointTileRectangle", 4, ".iib");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRailStationTileRectangle, "RemoveRailStationTileRectangle", 4, ".iib");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailTracks, "GetRailTracks", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailTrack, "BuildRailTrack", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRailTrack, "RemoveRailTrack", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::AreTilesConnected, "AreTilesConnected", 4, ".iii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRail, "BuildRail", 4, ".iii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRail, "RemoveRail", 4, ".iii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetSignalType, "GetSignalType", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildSignal, "BuildSignal", 4, ".iii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveSignal, "RemoveSignal", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetBuildCost, "GetBuildCost", 3, ".ii");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetMaxSpeed, "GetMaxSpeed", 2, ".i");
+ SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetMaintenanceCostFactor, "GetMaintenanceCostFactor", 2, ".i");
SQGSRail.PostRegister(engine);
}
diff --git a/src/script/api/game/game_road.hpp.sq b/src/script/api/game/game_road.hpp.sq
index f398b6b00..51da4144e 100644
--- a/src/script/api/game/game_road.hpp.sq
+++ b/src/script/api/game/game_road.hpp.sq
@@ -46,23 +46,35 @@ void SQGSRoad_Register(Squirrel *engine)
ScriptError::RegisterErrorMapString(ScriptRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD, "ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD");
ScriptError::RegisterErrorMapString(ScriptRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS, "ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetRoadVehicleTypeForCargo, "GetRoadVehicleTypeForCargo", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadTile, "IsRoadTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadDepotTile, "IsRoadDepotTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadStationTile, "IsRoadStationTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsDriveThroughRoadStationTile, "IsDriveThroughRoadStationTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetCurrentRoadType, "GetCurrentRoadType", 1, ".");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::SetCurrentRoadType, "SetCurrentRoadType", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::HasRoadType, "HasRoadType", 3, ".ii");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::AreRoadTilesConnected, "AreRoadTilesConnected", 3, ".ii");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetNeighbourRoadCount, "GetNeighbourRoadCount", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetRoadDepotFrontTile, "GetRoadDepotFrontTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetRoadStationFrontTile, "GetRoadStationFrontTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetDriveThroughBackTile, "GetDriveThroughBackTile", 2, ".i");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildRoad, "BuildRoad", 3, ".ii");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildRoadFull, "BuildRoadFull", 3, ".ii");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetBuildCost, "GetBuildCost", 3, ".ii");
- SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetMaintenanceCostFactor, "GetMaintenanceCostFactor", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetRoadVehicleTypeForCargo, "GetRoadVehicleTypeForCargo", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadTile, "IsRoadTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadDepotTile, "IsRoadDepotTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadStationTile, "IsRoadStationTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsDriveThroughRoadStationTile, "IsDriveThroughRoadStationTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::IsRoadTypeAvailable, "IsRoadTypeAvailable", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetCurrentRoadType, "GetCurrentRoadType", 1, ".");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::SetCurrentRoadType, "SetCurrentRoadType", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::HasRoadType, "HasRoadType", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::AreRoadTilesConnected, "AreRoadTilesConnected", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::CanBuildConnectedRoadParts, "CanBuildConnectedRoadParts", 5, ".iaii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::CanBuildConnectedRoadPartsHere, "CanBuildConnectedRoadPartsHere", 4, ".iii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetNeighbourRoadCount, "GetNeighbourRoadCount", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetRoadDepotFrontTile, "GetRoadDepotFrontTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetRoadStationFrontTile, "GetRoadStationFrontTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetDriveThroughBackTile, "GetDriveThroughBackTile", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildRoad, "BuildRoad", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildOneWayRoad, "BuildOneWayRoad", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildRoadFull, "BuildRoadFull", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildOneWayRoadFull, "BuildOneWayRoadFull", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildRoadDepot, "BuildRoadDepot", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildRoadStation, "BuildRoadStation", 5, ".iiii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::BuildDriveThroughRoadStation, "BuildDriveThroughRoadStation", 5, ".iiii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::RemoveRoad, "RemoveRoad", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::RemoveRoadFull, "RemoveRoadFull", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::RemoveRoadDepot, "RemoveRoadDepot", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::RemoveRoadStation, "RemoveRoadStation", 2, ".i");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetBuildCost, "GetBuildCost", 3, ".ii");
+ SQGSRoad.DefSQStaticMethod(engine, &ScriptRoad::GetMaintenanceCostFactor, "GetMaintenanceCostFactor", 2, ".i");
SQGSRoad.PostRegister(engine);
}
diff --git a/src/script/api/game/game_tile.hpp.sq b/src/script/api/game/game_tile.hpp.sq
index a25a175b5..c2d5cb55e 100644
--- a/src/script/api/game/game_tile.hpp.sq
+++ b/src/script/api/game/game_tile.hpp.sq
@@ -101,6 +101,12 @@ void SQGSTile_Register(Squirrel *engine)
SQGSTile.DefSQStaticMethod(engine, &ScriptTile::GetCargoProduction, "GetCargoProduction", 6, ".iiiii");
SQGSTile.DefSQStaticMethod(engine, &ScriptTile::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii");
SQGSTile.DefSQStaticMethod(engine, &ScriptTile::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii");
+ SQGSTile.DefSQStaticMethod(engine, &ScriptTile::RaiseTile, "RaiseTile", 3, ".ii");
+ SQGSTile.DefSQStaticMethod(engine, &ScriptTile::LowerTile, "LowerTile", 3, ".ii");
+ SQGSTile.DefSQStaticMethod(engine, &ScriptTile::LevelTiles, "LevelTiles", 3, ".ii");
+ SQGSTile.DefSQStaticMethod(engine, &ScriptTile::DemolishTile, "DemolishTile", 2, ".i");
+ SQGSTile.DefSQStaticMethod(engine, &ScriptTile::PlantTree, "PlantTree", 2, ".i");
+ SQGSTile.DefSQStaticMethod(engine, &ScriptTile::PlantTreeRectangle, "PlantTreeRectangle", 4, ".iii");
SQGSTile.DefSQStaticMethod(engine, &ScriptTile::IsWithinTownInfluence, "IsWithinTownInfluence", 3, ".ii");
SQGSTile.DefSQStaticMethod(engine, &ScriptTile::GetTownAuthority, "GetTownAuthority", 2, ".i");
SQGSTile.DefSQStaticMethod(engine, &ScriptTile::GetClosestTown, "GetClosestTown", 2, ".i");
diff --git a/src/script/api/game/game_town.hpp.sq b/src/script/api/game/game_town.hpp.sq
index ad0dfe428..ddd80c59d 100644
--- a/src/script/api/game/game_town.hpp.sq
+++ b/src/script/api/game/game_town.hpp.sq
@@ -21,21 +21,29 @@ void SQGSTown_Register(Squirrel *engine)
SQGSTown.PreRegister(engine);
SQGSTown.AddConstructor<void (ScriptTown::*)(), 1>(engine, "x");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_NONE, "TOWN_RATING_NONE");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_APPALLING, "TOWN_RATING_APPALLING");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_VERY_POOR, "TOWN_RATING_VERY_POOR");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_POOR, "TOWN_RATING_POOR");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_MEDIOCRE, "TOWN_RATING_MEDIOCRE");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_GOOD, "TOWN_RATING_GOOD");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_VERY_GOOD, "TOWN_RATING_VERY_GOOD");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_EXCELLENT, "TOWN_RATING_EXCELLENT");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_OUTSTANDING, "TOWN_RATING_OUTSTANDING");
- SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_INVALID, "TOWN_RATING_INVALID");
- SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_ORIGINAL, "ROAD_LAYOUT_ORIGINAL");
- SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_BETTER_ROADS, "ROAD_LAYOUT_BETTER_ROADS");
- SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_2x2, "ROAD_LAYOUT_2x2");
- SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_3x3, "ROAD_LAYOUT_3x3");
- SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_INVALID, "ROAD_LAYOUT_INVALID");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_ADVERTISE_SMALL, "TOWN_ACTION_ADVERTISE_SMALL");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_ADVERTISE_MEDIUM, "TOWN_ACTION_ADVERTISE_MEDIUM");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_ADVERTISE_LARGE, "TOWN_ACTION_ADVERTISE_LARGE");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_ROAD_REBUILD, "TOWN_ACTION_ROAD_REBUILD");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_BUILD_STATUE, "TOWN_ACTION_BUILD_STATUE");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_FUND_BUILDINGS, "TOWN_ACTION_FUND_BUILDINGS");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_BUY_RIGHTS, "TOWN_ACTION_BUY_RIGHTS");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_ACTION_BRIBE, "TOWN_ACTION_BRIBE");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_NONE, "TOWN_RATING_NONE");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_APPALLING, "TOWN_RATING_APPALLING");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_VERY_POOR, "TOWN_RATING_VERY_POOR");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_POOR, "TOWN_RATING_POOR");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_MEDIOCRE, "TOWN_RATING_MEDIOCRE");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_GOOD, "TOWN_RATING_GOOD");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_VERY_GOOD, "TOWN_RATING_VERY_GOOD");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_EXCELLENT, "TOWN_RATING_EXCELLENT");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_OUTSTANDING, "TOWN_RATING_OUTSTANDING");
+ SQGSTown.DefSQConst(engine, ScriptTown::TOWN_RATING_INVALID, "TOWN_RATING_INVALID");
+ SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_ORIGINAL, "ROAD_LAYOUT_ORIGINAL");
+ SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_BETTER_ROADS, "ROAD_LAYOUT_BETTER_ROADS");
+ SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_2x2, "ROAD_LAYOUT_2x2");
+ SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_3x3, "ROAD_LAYOUT_3x3");
+ SQGSTown.DefSQConst(engine, ScriptTown::ROAD_LAYOUT_INVALID, "ROAD_LAYOUT_INVALID");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetTownCount, "GetTownCount", 1, ".");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::IsValidTown, "IsValidTown", 2, ".i");
@@ -55,9 +63,13 @@ void SQGSTown_Register(Squirrel *engine)
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::IsWithinTownInfluence, "IsWithinTownInfluence", 3, ".ii");
+ SQGSTown.DefSQStaticMethod(engine, &ScriptTown::HasStatue, "HasStatue", 2, ".i");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::IsCity, "IsCity", 2, ".i");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetRoadReworkDuration, "GetRoadReworkDuration", 2, ".i");
+ SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetExclusiveRightsCompany, "GetExclusiveRightsCompany", 2, ".i");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetExclusiveRightsDuration, "GetExclusiveRightsDuration", 2, ".i");
+ SQGSTown.DefSQStaticMethod(engine, &ScriptTown::IsActionAvailable, "IsActionAvailable", 3, ".ii");
+ SQGSTown.DefSQStaticMethod(engine, &ScriptTown::PerformTownAction, "PerformTownAction", 3, ".ii");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::ExpandTown, "ExpandTown", 3, ".ii");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetRating, "GetRating", 3, ".ii");
SQGSTown.DefSQStaticMethod(engine, &ScriptTown::GetAllowedNoise, "GetAllowedNoise", 2, ".i");
diff --git a/src/script/api/game/game_tunnel.hpp.sq b/src/script/api/game/game_tunnel.hpp.sq
index e2d94bfcd..cea1cf11c 100644
--- a/src/script/api/game/game_tunnel.hpp.sq
+++ b/src/script/api/game/game_tunnel.hpp.sq
@@ -40,6 +40,7 @@ void SQGSTunnel_Register(Squirrel *engine)
SQGSTunnel.DefSQStaticMethod(engine, &ScriptTunnel::IsTunnelTile, "IsTunnelTile", 2, ".i");
SQGSTunnel.DefSQStaticMethod(engine, &ScriptTunnel::GetOtherTunnelEnd, "GetOtherTunnelEnd", 2, ".i");
SQGSTunnel.DefSQStaticMethod(engine, &ScriptTunnel::BuildTunnel, "BuildTunnel", 3, ".ii");
+ SQGSTunnel.DefSQStaticMethod(engine, &ScriptTunnel::RemoveTunnel, "RemoveTunnel", 2, ".i");
SQGSTunnel.PostRegister(engine);
}
diff --git a/src/script/api/game/game_vehicle.hpp.sq b/src/script/api/game/game_vehicle.hpp.sq
index 9fc5599cd..3dc9fe67a 100644
--- a/src/script/api/game/game_vehicle.hpp.sq
+++ b/src/script/api/game/game_vehicle.hpp.sq
@@ -99,37 +99,50 @@ void SQGSVehicle_Register(Squirrel *engine)
ScriptError::RegisterErrorMapString(ScriptVehicle::ERR_VEHICLE_NO_POWER, "ERR_VEHICLE_NO_POWER");
ScriptError::RegisterErrorMapString(ScriptVehicle::ERR_VEHICLE_TOO_LONG, "ERR_VEHICLE_TOO_LONG");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsValidVehicle, "IsValidVehicle", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetNumWagons, "GetNumWagons", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetName, "GetName", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetOwner, "GetOwner", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetLocation, "GetLocation", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetEngineType, "GetEngineType", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetWagonEngineType, "GetWagonEngineType", 3, ".ii");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetUnitNumber, "GetUnitNumber", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetAge, "GetAge", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetWagonAge, "GetWagonAge", 3, ".ii");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetMaxAge, "GetMaxAge", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetAgeLeft, "GetAgeLeft", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCurrentSpeed, "GetCurrentSpeed", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetState, "GetState", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetRunningCost, "GetRunningCost", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetProfitThisYear, "GetProfitThisYear", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetProfitLastYear, "GetProfitLastYear", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCurrentValue, "GetCurrentValue", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetVehicleType, "GetVehicleType", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetRoadType, "GetRoadType", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsInDepot, "IsInDepot", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsStoppedInDepot, "IsStoppedInDepot", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetRefitCapacity, "GetRefitCapacity", 3, ".ii");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCapacity, "GetCapacity", 3, ".ii");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetLength, "GetLength", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCargoLoad, "GetCargoLoad", 3, ".ii");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetGroupID, "GetGroupID", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsArticulated, "IsArticulated", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::HasSharedOrders, "HasSharedOrders", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetReliability, "GetReliability", 2, ".i");
- SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetMaximumOrderDistance, "GetMaximumOrderDistance", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsValidVehicle, "IsValidVehicle", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetNumWagons, "GetNumWagons", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::SetName, "SetName", 3, ".i.");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetName, "GetName", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetOwner, "GetOwner", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetLocation, "GetLocation", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetEngineType, "GetEngineType", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetWagonEngineType, "GetWagonEngineType", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetUnitNumber, "GetUnitNumber", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetAge, "GetAge", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetWagonAge, "GetWagonAge", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetMaxAge, "GetMaxAge", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetAgeLeft, "GetAgeLeft", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCurrentSpeed, "GetCurrentSpeed", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetState, "GetState", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetRunningCost, "GetRunningCost", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetProfitThisYear, "GetProfitThisYear", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetProfitLastYear, "GetProfitLastYear", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCurrentValue, "GetCurrentValue", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetVehicleType, "GetVehicleType", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetRoadType, "GetRoadType", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsInDepot, "IsInDepot", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsStoppedInDepot, "IsStoppedInDepot", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::BuildVehicle, "BuildVehicle", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::CloneVehicle, "CloneVehicle", 4, ".iib");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::MoveWagon, "MoveWagon", 5, ".iiii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::MoveWagonChain, "MoveWagonChain", 5, ".iiii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetRefitCapacity, "GetRefitCapacity", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::RefitVehicle, "RefitVehicle", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::SellVehicle, "SellVehicle", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::SellWagon, "SellWagon", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::SellWagonChain, "SellWagonChain", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::SendVehicleToDepot, "SendVehicleToDepot", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::SendVehicleToDepotForServicing, "SendVehicleToDepotForServicing", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::StartStopVehicle, "StartStopVehicle", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::ReverseVehicle, "ReverseVehicle", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCapacity, "GetCapacity", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetLength, "GetLength", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetCargoLoad, "GetCargoLoad", 3, ".ii");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetGroupID, "GetGroupID", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::IsArticulated, "IsArticulated", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::HasSharedOrders, "HasSharedOrders", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetReliability, "GetReliability", 2, ".i");
+ SQGSVehicle.DefSQStaticMethod(engine, &ScriptVehicle::GetMaximumOrderDistance, "GetMaximumOrderDistance", 2, ".i");
SQGSVehicle.PostRegister(engine);
}
diff --git a/src/script/api/script_airport.cpp b/src/script/api/script_airport.cpp
index 129ba62ea..438a18ae9 100644
--- a/src/script/api/script_airport.cpp
+++ b/src/script/api/script_airport.cpp
@@ -70,6 +70,7 @@
/* static */ bool ScriptAirport::BuildAirport(TileIndex tile, AirportType type, StationID station_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsValidAirportType(type));
EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id));
@@ -81,6 +82,7 @@
/* static */ bool ScriptAirport::RemoveAirport(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile))
EnforcePrecondition(false, IsAirportTile(tile) || IsHangarTile(tile));
diff --git a/src/script/api/script_airport.hpp b/src/script/api/script_airport.hpp
index c4bb627a0..ddf51860a 100644
--- a/src/script/api/script_airport.hpp
+++ b/src/script/api/script_airport.hpp
@@ -144,13 +144,13 @@ public:
* @pre ScriptMap::IsValidTile(tile).
* @pre AirportAvailable(type).
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
* @exception ScriptError::ERR_LOCAL_AUTHORITY_REFUSES
* @exception ScriptStation::ERR_STATION_TOO_LARGE
* @exception ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
* @return Whether the airport has been/can be build or not.
- * @api -game
*/
static bool BuildAirport(TileIndex tile, AirportType type, StationID station_id);
@@ -158,9 +158,9 @@ public:
* Removes an airport.
* @param tile Any tile of the airport.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the airport has been/can be removed or not.
- * @api -game
*/
static bool RemoveAirport(TileIndex tile);
diff --git a/src/script/api/script_basestation.cpp b/src/script/api/script_basestation.cpp
index 5bd87ff78..84c41abce 100644
--- a/src/script/api/script_basestation.cpp
+++ b/src/script/api/script_basestation.cpp
@@ -36,6 +36,7 @@
/* static */ bool ScriptBaseStation::SetName(StationID station_id, const char *name)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidBaseStation(station_id));
EnforcePrecondition(false, !::StrEmpty(name));
EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_STATION_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
diff --git a/src/script/api/script_basestation.hpp b/src/script/api/script_basestation.hpp
index c7b462f7e..7007985ae 100644
--- a/src/script/api/script_basestation.hpp
+++ b/src/script/api/script_basestation.hpp
@@ -53,9 +53,9 @@ public:
* @pre IsValidBaseStation(station_id).
* @pre 'name' must have at least one character.
* @pre 'name' must have at most 30 characters.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_NAME_IS_NOT_UNIQUE
* @return True if the name was changed.
- * @api -game
*/
static bool SetName(StationID station_id, const char *name);
diff --git a/src/script/api/script_bridge.cpp b/src/script/api/script_bridge.cpp
index a26894523..57e414dbd 100644
--- a/src/script/api/script_bridge.cpp
+++ b/src/script/api/script_bridge.cpp
@@ -128,6 +128,7 @@ static void _DoCommandReturnBuildBridge1(class ScriptInstance *instance)
/* static */ bool ScriptBridge::RemoveBridge(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsBridgeTile(tile));
return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
}
diff --git a/src/script/api/script_bridge.hpp b/src/script/api/script_bridge.hpp
index 267782603..8a00206fd 100644
--- a/src/script/api/script_bridge.hpp
+++ b/src/script/api/script_bridge.hpp
@@ -154,9 +154,9 @@ public:
* Removes a bridge, by executing it on either the start or end tile.
* @param tile An end or start tile of the bridge.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the bridge has been/can be removed or not.
- * @api -game
*/
static bool RemoveBridge(TileIndex tile);
diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp
index 6d11c17ac..efc2848a5 100644
--- a/src/script/api/script_company.cpp
+++ b/src/script/api/script_company.cpp
@@ -191,6 +191,7 @@
/* static */ bool ScriptCompany::SetLoanAmount(int32 loan)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, loan >= 0);
EnforcePrecondition(false, (loan % GetLoanInterval()) == 0);
EnforcePrecondition(false, loan <= GetMaxLoanAmount());
@@ -205,6 +206,7 @@
/* static */ bool ScriptCompany::SetMinimumLoanAmount(int32 loan)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, loan >= 0);
int32 over_interval = loan % GetLoanInterval();
@@ -219,6 +221,7 @@
/* static */ bool ScriptCompany::BuildCompanyHQ(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
return ScriptObject::DoCommand(tile, OBJECT_HQ, 0, CMD_BUILD_OBJECT);
diff --git a/src/script/api/script_company.hpp b/src/script/api/script_company.hpp
index c49b0ee00..de15b7ab2 100644
--- a/src/script/api/script_company.hpp
+++ b/src/script/api/script_company.hpp
@@ -123,8 +123,8 @@ public:
* @pre GetLoanInterval() must be a multiplier of 'loan'.
* @pre 'loan' must be below GetMaxLoanAmount().
* @pre 'loan' - GetLoanAmount() + GetBankBalance() must be non-negative.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if the loan could be set to your requested amount.
- * @api -game
*/
static bool SetLoanAmount(int32 loan);
@@ -133,8 +133,8 @@ public:
* @param loan The amount to loan (any positive number).
* @pre 'loan' must be non-negative.
* @pre 'loan' must be below GetMaxLoanAmount().
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if we could allocate a minimum of 'loan' loan.
- * @api -game
*/
static bool SetMinimumLoanAmount(int32 loan);
@@ -223,12 +223,12 @@ public:
* Build your company's HQ on the given tile.
* @param tile The tile to build your HQ on, this tile is the most nothern tile of your HQ.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
* @return True if the HQ could be build.
* @note An HQ can not be removed, only by water or rebuilding; If an HQ is
* build again, the old one is removed.
- * @api -game
*/
static bool BuildCompanyHQ(TileIndex tile);
diff --git a/src/script/api/script_industrytype.cpp b/src/script/api/script_industrytype.cpp
index f61bedd3f..cbb8369b5 100644
--- a/src/script/api/script_industrytype.cpp
+++ b/src/script/api/script_industrytype.cpp
@@ -111,6 +111,7 @@
/* static */ bool ScriptIndustryType::BuildIndustry(IndustryType industry_type, TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, CanBuildIndustry(industry_type));
EnforcePrecondition(false, ScriptMap::IsValidTile(tile));
@@ -120,6 +121,7 @@
/* static */ bool ScriptIndustryType::ProspectIndustry(IndustryType industry_type)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, CanProspectIndustry(industry_type));
uint32 seed = ::InteractiveRandom();
diff --git a/src/script/api/script_industrytype.hpp b/src/script/api/script_industrytype.hpp
index 9e205df96..1d642ac38 100644
--- a/src/script/api/script_industrytype.hpp
+++ b/src/script/api/script_industrytype.hpp
@@ -111,8 +111,8 @@ public:
* @param industry_type The type of the industry to build.
* @param tile The tile to build the industry on.
* @pre CanBuildIndustry(industry_type).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if the industry was successfully build.
- * @api -game
*/
static bool BuildIndustry(IndustryType industry_type, TileIndex tile);
@@ -121,10 +121,10 @@ public:
* an industry on a random place on the map.
* @param industry_type The type of the industry.
* @pre CanProspectIndustry(industry_type).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if no error occurred while trying to prospect.
* @note Even if true is returned there is no guarantee a new industry is build.
* @note If true is returned the money is paid, whether a new industry was build or not.
- * @api -game
*/
static bool ProspectIndustry(IndustryType industry_type);
diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp
index f67b8d24c..abc8666f1 100644
--- a/src/script/api/script_marine.cpp
+++ b/src/script/api/script_marine.cpp
@@ -73,6 +73,7 @@
/* static */ bool ScriptMarine::BuildWaterDepot(TileIndex tile, TileIndex front)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(front));
EnforcePrecondition(false, (::TileX(front) == ::TileX(tile)) != (::TileY(front) == ::TileY(tile)));
@@ -82,6 +83,7 @@
/* static */ bool ScriptMarine::BuildDock(TileIndex tile, StationID station_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id));
@@ -92,6 +94,7 @@
/* static */ bool ScriptMarine::BuildBuoy(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
return ScriptObject::DoCommand(tile, 0, 0, CMD_BUILD_BUOY);
@@ -99,6 +102,7 @@
/* static */ bool ScriptMarine::BuildLock(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
return ScriptObject::DoCommand(tile, 0, 0, CMD_BUILD_LOCK);
@@ -106,6 +110,7 @@
/* static */ bool ScriptMarine::BuildCanal(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
return ScriptObject::DoCommand(tile, tile, WATER_CLASS_CANAL, CMD_BUILD_CANAL);
@@ -113,6 +118,7 @@
/* static */ bool ScriptMarine::RemoveWaterDepot(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsWaterDepotTile(tile));
@@ -121,6 +127,7 @@
/* static */ bool ScriptMarine::RemoveDock(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsDockTile(tile));
@@ -129,6 +136,7 @@
/* static */ bool ScriptMarine::RemoveBuoy(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsBuoyTile(tile));
@@ -137,6 +145,7 @@
/* static */ bool ScriptMarine::RemoveLock(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsLockTile(tile));
@@ -145,6 +154,7 @@
/* static */ bool ScriptMarine::RemoveCanal(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsCanalTile(tile));
diff --git a/src/script/api/script_marine.hpp b/src/script/api/script_marine.hpp
index 95e7041e0..d70121029 100644
--- a/src/script/api/script_marine.hpp
+++ b/src/script/api/script_marine.hpp
@@ -99,13 +99,13 @@ public:
* @param front A tile on the same axis with 'tile' as the depot shall be oriented.
* @pre ScriptMap::IsValidTile(tile).
* @pre ScriptMap::IsValidTile(front).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @exception ScriptMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER
* @return Whether the water depot has been/can be build or not.
* @note A WaterDepot is 1 tile in width, and 2 tiles in length.
* @note The depot will be built towards the south from 'tile', not necessarily towards 'front'.
- * @api -game
*/
static bool BuildWaterDepot(TileIndex tile, TileIndex front);
@@ -115,12 +115,12 @@ public:
* @param station_id The station to join, ScriptStation::STATION_NEW or ScriptStation::STATION_JOIN_ADJACENT.
* @pre ScriptMap::IsValidTile(tile).
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @exception ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
* @return Whether the dock has been/can be build or not.
- * @api -game
*/
static bool BuildDock(TileIndex tile, StationID station_id);
@@ -128,11 +128,11 @@ public:
* Builds a buoy on tile.
* @param tile The tile where the buoy will be build.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
* @return Whether the buoy has been/can be build or not.
- * @api -game
*/
static bool BuildBuoy(TileIndex tile);
@@ -140,10 +140,10 @@ public:
* Builds a lock on tile.
* @param tile The tile where the lock will be build.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @return Whether the lock has been/can be build or not.
- * @api -game
*/
static bool BuildLock(TileIndex tile);
@@ -151,12 +151,12 @@ public:
* Builds a canal on tile.
* @param tile The tile where the canal will be build.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_ALREADY_BUILT
* @return Whether the canal has been/can be build or not.
- * @api -game
*/
static bool BuildCanal(TileIndex tile);
@@ -164,9 +164,9 @@ public:
* Removes a water depot.
* @param tile Any tile of the water depot.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the water depot has been/can be removed or not.
- * @api -game
*/
static bool RemoveWaterDepot(TileIndex tile);
@@ -174,9 +174,9 @@ public:
* Removes a dock.
* @param tile Any tile of the dock.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the dock has been/can be removed or not.
- * @api -game
*/
static bool RemoveDock(TileIndex tile);
@@ -184,9 +184,9 @@ public:
* Removes a buoy.
* @param tile Any tile of the buoy.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the buoy has been/can be removed or not.
- * @api -game
*/
static bool RemoveBuoy(TileIndex tile);
@@ -194,9 +194,9 @@ public:
* Removes a lock.
* @param tile Any tile of the lock.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the lock has been/can be removed or not.
- * @api -game
*/
static bool RemoveLock(TileIndex tile);
@@ -204,9 +204,9 @@ public:
* Removes a canal.
* @param tile Any tile of the canal.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the canal has been/can be removed or not.
- * @api -game
*/
static bool RemoveCanal(TileIndex tile);
diff --git a/src/script/api/script_rail.cpp b/src/script/api/script_rail.cpp
index edd931388..f77894d92 100644
--- a/src/script/api/script_rail.cpp
+++ b/src/script/api/script_rail.cpp
@@ -113,6 +113,7 @@
/* static */ bool ScriptRail::ConvertRailType(TileIndex start_tile, TileIndex end_tile, ScriptRail::RailType convert_to)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(start_tile));
EnforcePrecondition(false, ::IsValidTile(end_tile));
EnforcePrecondition(false, IsRailTypeAvailable(convert_to));
@@ -136,6 +137,7 @@
/* static */ bool ScriptRail::BuildRailDepot(TileIndex tile, TileIndex front)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, tile != front);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(front));
@@ -149,6 +151,7 @@
/* static */ bool ScriptRail::BuildRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, direction == RAILTRACK_NW_SE || direction == RAILTRACK_NE_SW);
EnforcePrecondition(false, num_platforms > 0 && num_platforms <= 0xFF);
@@ -164,6 +167,7 @@
/* static */ bool ScriptRail::BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, direction == RAILTRACK_NW_SE || direction == RAILTRACK_NE_SW);
EnforcePrecondition(false, num_platforms > 0 && num_platforms <= 0xFF);
@@ -196,6 +200,7 @@
/* static */ bool ScriptRail::BuildRailWaypoint(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsRailTile(tile));
EnforcePrecondition(false, GetRailTracks(tile) == RAILTRACK_NE_SW || GetRailTracks(tile) == RAILTRACK_NW_SE);
@@ -206,6 +211,7 @@
/* static */ bool ScriptRail::RemoveRailWaypointTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(tile2));
@@ -214,6 +220,7 @@
/* static */ bool ScriptRail::RemoveRailStationTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(tile2));
@@ -232,6 +239,7 @@
/* static */ bool ScriptRail::BuildRailTrack(TileIndex tile, RailTrack rail_track)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, rail_track != 0);
EnforcePrecondition(false, (rail_track & ~::TRACK_BIT_ALL) == 0);
@@ -243,6 +251,7 @@
/* static */ bool ScriptRail::RemoveRailTrack(TileIndex tile, RailTrack rail_track)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsPlainRailTile(tile) || ::IsLevelCrossingTile(tile));
EnforcePrecondition(false, GetRailTracks(tile) & rail_track);
@@ -336,6 +345,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
/* static */ bool ScriptRail::BuildRail(TileIndex from, TileIndex tile, TileIndex to)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(from));
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(to));
@@ -353,6 +363,7 @@ static uint32 SimulateDrag(TileIndex from, TileIndex tile, TileIndex *to)
/* static */ bool ScriptRail::RemoveRail(TileIndex from, TileIndex tile, TileIndex to)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(from));
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(to));
@@ -426,6 +437,7 @@ static bool IsValidSignalType(int signal_type)
/* static */ bool ScriptRail::BuildSignal(TileIndex tile, TileIndex front, SignalType signal)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ScriptMap::DistanceManhattan(tile, front) == 1)
EnforcePrecondition(false, ::IsPlainRailTile(tile));
EnforcePrecondition(false, ::IsValidSignalType(signal));
@@ -455,6 +467,7 @@ static bool IsValidSignalType(int signal_type)
/* static */ bool ScriptRail::RemoveSignal(TileIndex tile, TileIndex front)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ScriptMap::DistanceManhattan(tile, front) == 1)
EnforcePrecondition(false, GetSignalType(tile, front) != SIGNALTYPE_NONE);
diff --git a/src/script/api/script_rail.hpp b/src/script/api/script_rail.hpp
index f76d53531..21dfab356 100644
--- a/src/script/api/script_rail.hpp
+++ b/src/script/api/script_rail.hpp
@@ -203,9 +203,9 @@ public:
* @pre ScriptMap::IsValidTile(start_tile).
* @pre ScriptMap::IsValidTile(end_tile).
* @pre IsRailTypeAvailable(convert_to).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
* @return Whether at least some rail has been converted successfully.
- * @api -game
*/
static bool ConvertRailType(TileIndex start_tile, TileIndex end_tile, ScriptRail::RailType convert_to);
@@ -233,10 +233,10 @@ public:
* @pre ScriptMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre IsRailTypeAvailable(GetCurrentRailType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @return Whether the rail depot has been/can be build or not.
- * @api -game
*/
static bool BuildRailDepot(TileIndex tile, TileIndex front);
@@ -253,6 +253,7 @@ public:
* @pre num_platforms > 0 && num_platforms <= 255.
* @pre platform_length > 0 && platform_length <= 255.
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
@@ -260,7 +261,6 @@ public:
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
* @return Whether the station has been/can be build or not.
- * @api -game
*/
static bool BuildRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id);
@@ -287,6 +287,7 @@ public:
* @pre ScriptCargo::IsValidCargo(cargo_type)
* @pre source_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || source_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(source_industry).
* @pre goal_industry == ScriptIndustryType::INDUSTRYTYPE_UNKNOWN || goal_industry == ScriptIndustryType::INDUSTRYTYPE_TOWN || ScriptIndustryType::IsValidIndustryType(goal_industry).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
@@ -294,7 +295,6 @@ public:
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
* @return Whether the station has been/can be build or not.
- * @api -game
*/
static bool BuildNewGRFRailStation(TileIndex tile, RailTrack direction, uint num_platforms, uint platform_length, StationID station_id, CargoID cargo_id, IndustryType source_industry, IndustryType goal_industry, int distance, bool source_station);
@@ -305,9 +305,9 @@ public:
* @pre IsRailTile(tile).
* @pre GetRailTracks(tile) == RAILTRACK_NE_SW || GetRailTracks(tile) == RAILTRACK_NW_SE.
* @pre IsRailTypeAvailable(GetCurrentRailType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
* @return Whether the rail waypoint has been/can be build or not.
- * @api -game
*/
static bool BuildRailWaypoint(TileIndex tile);
@@ -318,8 +318,8 @@ public:
* @param keep_rail Whether to keep the rail after removal.
* @pre IsValidTile(tile).
* @pre IsValidTile(tile2).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether at least one tile has been/can be cleared or not.
- * @api -game
*/
static bool RemoveRailWaypointTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail);
@@ -330,8 +330,8 @@ public:
* @param keep_rail Whether to keep the rail after removal.
* @pre IsValidTile(tile).
* @pre IsValidTile(tile2).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether at least one tile has been/can be cleared or not.
- * @api -game
*/
static bool RemoveRailStationTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail);
@@ -350,6 +350,7 @@ public:
* @param rail_track The RailTrack to build.
* @pre ScriptMap::IsValidTile(tile).
* @pre IsRailTypeAvailable(GetCurrentRailType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
@@ -358,7 +359,6 @@ public:
* @return Whether the rail has been/can be build or not.
* @note You can only build a single track with this function so do not
* use the values from RailTrack as bitmask.
- * @api -game
*/
static bool BuildRailTrack(TileIndex tile, RailTrack rail_track);
@@ -368,10 +368,10 @@ public:
* @param rail_track The RailTrack to remove.
* @pre ScriptMap::IsValidTile(tile).
* @pre (GetRailTracks(tile) & rail_track) != 0.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether the rail has been/can be removed or not.
* @note You can only remove a single track with this function so do not
* use the values from RailTrack as bitmask.
- * @api -game
*/
static bool RemoveRailTrack(TileIndex tile, RailTrack rail_track);
@@ -400,6 +400,7 @@ public:
* (ScriptMap::GetTileX(from) == ScriptMap::GetTileX(tile) && ScriptMap::GetTileX(tile) == ScriptMap::GetTileX(to)) ||
* (ScriptMap::GetTileY(from) == ScriptMap::GetTileY(tile) && ScriptMap::GetTileY(tile) == ScriptMap::GetTileY(to)).
* @pre IsRailTypeAvailable(GetCurrentRailType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD
@@ -407,7 +408,6 @@ public:
* @exception ScriptError::ERR_ALREADY_BUILT
* @note Construction will fail if an obstacle is found between the start and end tiles.
* @return Whether the rail has been/can be build or not.
- * @api -game
*/
static bool BuildRail(TileIndex from, TileIndex tile, TileIndex to);
@@ -423,8 +423,8 @@ public:
* abs(ScriptMap::GetTileY(to) - ScriptMap::GetTileY(tile))) <= 1) ||
* (ScriptMap::GetTileX(from) == ScriptMap::GetTileX(tile) && ScriptMap::GetTileX(tile) == ScriptMap::GetTileX(to)) ||
* (ScriptMap::GetTileY(from) == ScriptMap::GetTileY(tile) && ScriptMap::GetTileY(tile) == ScriptMap::GetTileY(to)).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether the rail has been/can be removed or not.
- * @api -game
*/
static bool RemoveRail(TileIndex from, TileIndex tile, TileIndex to);
@@ -444,9 +444,9 @@ public:
* @param signal The SignalType to build.
* @pre ScriptMap::DistanceManhattan(tile, front) == 1.
* @pre IsRailTile(tile) && !IsRailStationTile(tile) && !IsRailWaypointTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
* @return Whether the signal has been/can be build or not.
- * @api -game
*/
static bool BuildSignal(TileIndex tile, TileIndex front, SignalType signal);
@@ -456,8 +456,8 @@ public:
* @param front The tile in front of the signal.
* @pre ScriptMap::DistanceManhattan(tile, front) == 1.
* @pre GetSignalType(tile, front) != SIGNALTYPE_NONE.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether the signal has been/can be removed or not.
- * @api -game
*/
static bool RemoveSignal(TileIndex tile, TileIndex front);
diff --git a/src/script/api/script_road.cpp b/src/script/api/script_road.cpp
index b25f74c61..19db9a901 100644
--- a/src/script/api/script_road.cpp
+++ b/src/script/api/script_road.cpp
@@ -468,6 +468,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::BuildOneWayRoad(TileIndex start, TileIndex end)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
return _BuildRoadInternal(start, end, true, false);
}
@@ -478,11 +479,13 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::BuildOneWayRoadFull(TileIndex start, TileIndex end)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
return _BuildRoadInternal(start, end, true, true);
}
/* static */ bool ScriptRoad::BuildRoadDepot(TileIndex tile, TileIndex front)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, tile != front);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(front));
@@ -496,6 +499,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::_BuildRoadStationInternal(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, bool drive_through, StationID station_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, tile != front);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(front));
@@ -532,6 +536,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::RemoveRoad(TileIndex start, TileIndex end)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(start));
EnforcePrecondition(false, ::IsValidTile(end));
EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end));
@@ -542,6 +547,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::RemoveRoadFull(TileIndex start, TileIndex end)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(start));
EnforcePrecondition(false, ::IsValidTile(end));
EnforcePrecondition(false, ::TileX(start) == ::TileX(end) || ::TileY(start) == ::TileY(end));
@@ -552,6 +558,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::RemoveRoadDepot(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsTileType(tile, MP_ROAD))
EnforcePrecondition(false, GetRoadTileType(tile) == ROAD_TILE_DEPOT);
@@ -561,6 +568,7 @@ static bool NeighbourHasReachableRoad(::RoadTypes rts, TileIndex start_tile, Dia
/* static */ bool ScriptRoad::RemoveRoadStation(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, IsTileType(tile, MP_STATION));
EnforcePrecondition(false, IsRoadStop(tile));
diff --git a/src/script/api/script_road.hpp b/src/script/api/script_road.hpp
index 062a15ddf..9818fa55c 100644
--- a/src/script/api/script_road.hpp
+++ b/src/script/api/script_road.hpp
@@ -117,8 +117,8 @@ public:
/**
* Check if a given RoadType is available.
* @param road_type The RoadType to check for.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if this RoadType can be used.
- * @api -game
*/
static bool IsRoadTypeAvailable(RoadType road_type);
@@ -186,7 +186,6 @@ public:
* @return 0 when the build parts do not connect, 1 when they do connect once
* they are build or 2 when building the first part automatically
* builds the second part. -1 means the preconditions are not met.
- * @api -game
*/
static int32 CanBuildConnectedRoadParts(ScriptTile::Slope slope, struct Array *existing, TileIndex start, TileIndex end);
@@ -208,7 +207,6 @@ public:
* @return 0 when the build parts do not connect, 1 when they do connect once
* they are build or 2 when building the first part automatically
* builds the second part. -1 means the preconditions are not met.
- * @api -game
*/
static int32 CanBuildConnectedRoadPartsHere(TileIndex tile, TileIndex start, TileIndex end);
@@ -286,6 +284,7 @@ public:
* ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
* ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
* @pre GetCurrentRoadType() == ROADTYPE_ROAD.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_ALREADY_BUILT
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptError::ERR_AREA_NOT_CLEAR
@@ -294,7 +293,6 @@ public:
* @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
* @note Construction will fail if an obstacle is found between the start and end tiles.
* @return Whether the road has been/can be build or not.
- * @api -game
*/
static bool BuildOneWayRoad(TileIndex start, TileIndex end);
@@ -339,6 +337,7 @@ public:
* ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
* ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
* @pre GetCurrentRoadType() == ROADTYPE_ROAD.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_ALREADY_BUILT
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptError::ERR_AREA_NOT_CLEAR
@@ -347,7 +346,6 @@ public:
* @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
* @note Construction will fail if an obstacle is found between the start and end tiles.
* @return Whether the road has been/can be build or not.
- * @api -game
*/
static bool BuildOneWayRoadFull(TileIndex start, TileIndex end);
@@ -359,10 +357,10 @@ public:
* @pre ScriptMap::IsValidTile(front).
* @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @return Whether the road depot has been/can be build or not.
- * @api -game
*/
static bool BuildRoadDepot(TileIndex tile, TileIndex front);
@@ -377,6 +375,7 @@ public:
* @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
* @pre GetCurrentRoadType() == ROADTYPE_ROAD.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
@@ -387,7 +386,6 @@ public:
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
* @return Whether the station has been/can be build or not.
- * @api -game
*/
static bool BuildRoadStation(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, StationID station_id);
@@ -402,6 +400,7 @@ public:
* @pre 'tile' is not equal to 'front', but in a straight line of it.
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_FLAT_LAND_REQUIRED
@@ -412,7 +411,6 @@ public:
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
* @return Whether the station has been/can be build or not.
- * @api -game
*/
static bool BuildDriveThroughRoadStation(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, StationID station_id);
@@ -426,11 +424,11 @@ public:
* ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
* ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
* @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
* @return Whether the road has been/can be removed or not.
- * @api -game
*/
static bool RemoveRoad(TileIndex start, TileIndex end);
@@ -445,11 +443,11 @@ public:
* ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
* ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
* @pre IsRoadTypeAvailable(GetCurrentRoadType()).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
* @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
* @return Whether the road has been/can be removed or not.
- * @api -game
*/
static bool RemoveRoadFull(TileIndex start, TileIndex end);
@@ -458,10 +456,10 @@ public:
* @param tile Place to remove the depot from.
* @pre ScriptMap::IsValidTile(tile).
* @pre Tile is a road depot.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
* @return Whether the road depot has been/can be removed or not.
- * @api -game
*/
static bool RemoveRoadDepot(TileIndex tile);
@@ -470,10 +468,10 @@ public:
* @param tile Place to remove the station from.
* @pre ScriptMap::IsValidTile(tile).
* @pre Tile is a road station.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
* @return Whether the station has been/can be removed or not.
- * @api -game
*/
static bool RemoveRoadStation(TileIndex tile);
diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp
index 22f698268..a6bbf11ee 100644
--- a/src/script/api/script_tile.cpp
+++ b/src/script/api/script_tile.cpp
@@ -219,6 +219,7 @@
/* static */ bool ScriptTile::RaiseTile(TileIndex tile, int32 slope)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, tile < ::MapSize());
return ScriptObject::DoCommand(tile, slope, 1, CMD_TERRAFORM_LAND);
@@ -226,6 +227,7 @@
/* static */ bool ScriptTile::LowerTile(TileIndex tile, int32 slope)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, tile < ::MapSize());
return ScriptObject::DoCommand(tile, slope, 0, CMD_TERRAFORM_LAND);
@@ -233,6 +235,7 @@
/* static */ bool ScriptTile::LevelTiles(TileIndex start_tile, TileIndex end_tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, start_tile < ::MapSize());
EnforcePrecondition(false, end_tile < ::MapSize());
@@ -241,6 +244,7 @@
/* static */ bool ScriptTile::DemolishTile(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
@@ -248,6 +252,7 @@
/* static */ bool ScriptTile::PlantTree(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
return ScriptObject::DoCommand(tile, TREE_INVALID, tile, CMD_PLANT_TREE);
@@ -255,6 +260,7 @@
/* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, uint width, uint height)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, width >= 1 && width <= 20);
EnforcePrecondition(false, height >= 1 && height <= 20);
diff --git a/src/script/api/script_tile.hpp b/src/script/api/script_tile.hpp
index e9155f745..96f1a39bb 100644
--- a/src/script/api/script_tile.hpp
+++ b/src/script/api/script_tile.hpp
@@ -372,11 +372,11 @@ public:
* @param tile The tile to raise.
* @param slope Corners to raise (SLOPE_xxx).
* @pre tile < ScriptMap::GetMapSize().
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_TOO_CLOSE_TO_EDGE
* @exception ScriptTile::ERR_TILE_TOO_HIGH
* @return 0 means failed, 1 means success.
- * @api -game
*/
static bool RaiseTile(TileIndex tile, int32 slope);
@@ -389,11 +389,11 @@ public:
* @param tile The tile to lower.
* @param slope Corners to lower (SLOPE_xxx).
* @pre tile < ScriptMap::GetMapSize().
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_TOO_CLOSE_TO_EDGE
* @exception ScriptTile::ERR_TILE_TOO_LOW
* @return 0 means failed, 1 means success.
- * @api -game
*/
static bool LowerTile(TileIndex tile, int32 slope);
@@ -405,6 +405,7 @@ public:
* @param end_tile The opposite corner of the rectangle.
* @pre start_tile < ScriptMap::GetMapSize().
* @pre end_tile < ScriptMap::GetMapSize().
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_TOO_CLOSE_TO_EDGE
* @return True if one or more tiles were leveled.
@@ -412,7 +413,6 @@ public:
* successfully leveled already.
* @note This function may return true in ScriptTestMode, although it fails in
* ScriptExecMode.
- * @api -game
*/
static bool LevelTiles(TileIndex start_tile, TileIndex end_tile);
@@ -420,9 +420,9 @@ public:
* Destroy everything on the given tile.
* @param tile The tile to demolish.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @return True if and only if the tile was demolished.
- * @api -game
*/
static bool DemolishTile(TileIndex tile);
@@ -430,8 +430,8 @@ public:
* Create a random tree on a tile.
* @param tile The tile to build a tree on.
* @pre ScriptMap::IsValidTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if and only if a tree was added on the tile.
- * @api -game
*/
static bool PlantTree(TileIndex tile);
@@ -443,8 +443,8 @@ public:
* @pre ScriptMap::IsValidTile(tile).
* @pre width >= 1 && width <= 20.
* @pre height >= 1 && height <= 20.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if and only if a tree was added on any of the tiles in the rectangle.
- * @api -game
*/
static bool PlantTreeRectangle(TileIndex tile, uint width, uint height);
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp
index 88494215e..e1c0c0a85 100644
--- a/src/script/api/script_town.cpp
+++ b/src/script/api/script_town.cpp
@@ -176,6 +176,7 @@
/* static */ bool ScriptTown::HasStatue(TownID town_id)
{
+ if (ScriptObject::GetCompany() == OWNER_DEITY) return false;
if (!IsValidTown(town_id)) return false;
return ::HasBit(::Town::Get(town_id)->statues, ScriptObject::GetCompany());
@@ -197,6 +198,7 @@
/* static */ ScriptCompany::CompanyID ScriptTown::GetExclusiveRightsCompany(TownID town_id)
{
+ if (ScriptObject::GetCompany() == OWNER_DEITY) return ScriptCompany::COMPANY_INVALID;
if (!IsValidTown(town_id)) return ScriptCompany::COMPANY_INVALID;
return (ScriptCompany::CompanyID)(int8)::Town::Get(town_id)->exclusivity;
@@ -211,6 +213,7 @@
/* static */ bool ScriptTown::IsActionAvailable(TownID town_id, TownAction town_action)
{
+ if (ScriptObject::GetCompany() == OWNER_DEITY) return false;
if (!IsValidTown(town_id)) return false;
return HasBit(::GetMaskOfTownActions(NULL, ScriptObject::GetCompany(), ::Town::Get(town_id)), town_action);
@@ -218,6 +221,7 @@
/* static */ bool ScriptTown::PerformTownAction(TownID town_id, TownAction town_action)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidTown(town_id));
EnforcePrecondition(false, IsActionAvailable(town_id, town_action));
@@ -226,6 +230,7 @@
/* static */ bool ScriptTown::ExpandTown(TownID town_id, int houses)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
EnforcePrecondition(false, IsValidTown(town_id));
EnforcePrecondition(false, houses > 0);
diff --git a/src/script/api/script_town.hpp b/src/script/api/script_town.hpp
index d7f0c44f3..1138d3336 100644
--- a/src/script/api/script_town.hpp
+++ b/src/script/api/script_town.hpp
@@ -24,7 +24,6 @@ class ScriptTown : public ScriptObject {
public:
/**
* Actions that one can perform on a town.
- * @api -game
*/
enum TownAction {
/* Note: these values represent part of the in-game order of the _town_action_proc array */
@@ -281,8 +280,8 @@ public:
* Find out if this town has a statue for the current company.
* @param town_id The town to check.
* @pre IsValidTown(town_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if the town has a statue.
- * @api -game
*/
static bool HasStatue(TownID town_id);
@@ -307,10 +306,10 @@ public:
* Find out which company currently has the exclusive rights of this town.
* @param town_id The town to check.
* @pre IsValidTown(town_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return The company that has the exclusive rights. The value
* ScriptCompany::COMPANY_INVALID means that there are currently no
* exclusive rights given out to anyone.
- * @api -game
*/
static ScriptCompany::CompanyID GetExclusiveRightsCompany(TownID town_id);
@@ -329,8 +328,8 @@ public:
* @param town_id The town to perform the action on.
* @param town_action The action to perform on the town.
* @pre IsValidTown(town_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if and only if the action can performed.
- * @api -game
*/
static bool IsActionAvailable(TownID town_id, TownAction town_action);
@@ -340,8 +339,8 @@ public:
* @param town_action The action to perform on the town.
* @pre IsValidTown(town_id).
* @pre IsActionAvailable(town_id, town_action).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if the action succeeded.
- * @api -game
*/
static bool PerformTownAction(TownID town_id, TownAction town_action);
diff --git a/src/script/api/script_tunnel.cpp b/src/script/api/script_tunnel.cpp
index fbd1f5220..d7f6b853b 100644
--- a/src/script/api/script_tunnel.cpp
+++ b/src/script/api/script_tunnel.cpp
@@ -130,6 +130,7 @@ static void _DoCommandReturnBuildTunnel1(class ScriptInstance *instance)
/* static */ bool ScriptTunnel::RemoveTunnel(TileIndex tile)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsTunnelTile(tile));
return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
diff --git a/src/script/api/script_tunnel.hpp b/src/script/api/script_tunnel.hpp
index fbd30b19e..9911361f7 100644
--- a/src/script/api/script_tunnel.hpp
+++ b/src/script/api/script_tunnel.hpp
@@ -105,9 +105,9 @@ public:
* Remove the tunnel whose entrance is located at tile.
* @param tile The tile that is an entrance to a tunnel.
* @pre ScriptMap::IsValidTile(tile) && IsTunnelTile(tile).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the tunnel has been/can be removed or not.
- * @api -game
*/
static bool RemoveTunnel(TileIndex tile);
};
diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp
index d4f3056cc..9a73e564e 100644
--- a/src/script/api/script_vehicle.cpp
+++ b/src/script/api/script_vehicle.cpp
@@ -61,6 +61,7 @@
/* static */ VehicleID ScriptVehicle::BuildVehicle(TileIndex depot, EngineID engine_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(VEHICLE_INVALID, ScriptEngine::IsBuildable(engine_id));
::VehicleType type = ::Engine::Get(engine_id)->type;
@@ -75,6 +76,7 @@
/* static */ VehicleID ScriptVehicle::CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
if (!ScriptObject::DoCommand(depot, vehicle_id, share_orders, CMD_CLONE_VEHICLE, NULL, &ScriptInstance::DoCommandReturnVehicleID)) return VEHICLE_INVALID;
@@ -85,6 +87,7 @@
/* static */ bool ScriptVehicle::_MoveWagonInternal(VehicleID source_vehicle_id, int source_wagon, bool move_attached_wagons, int dest_vehicle_id, int dest_wagon)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(source_vehicle_id) && source_wagon < GetNumWagons(source_vehicle_id));
EnforcePrecondition(false, dest_vehicle_id == -1 || (IsValidVehicle(dest_vehicle_id) && dest_wagon < GetNumWagons(dest_vehicle_id)));
EnforcePrecondition(false, ::Vehicle::Get(source_vehicle_id)->type == VEH_TRAIN);
@@ -122,6 +125,7 @@
/* static */ bool ScriptVehicle::RefitVehicle(VehicleID vehicle_id, CargoID cargo)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id) && ScriptCargo::IsValidCargo(cargo));
return ScriptObject::DoCommand(0, vehicle_id, cargo, GetCmdRefitVeh(::Vehicle::Get(vehicle_id)));
@@ -130,6 +134,7 @@
/* static */ bool ScriptVehicle::SellVehicle(VehicleID vehicle_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
const Vehicle *v = ::Vehicle::Get(vehicle_id);
@@ -138,6 +143,7 @@
/* static */ bool ScriptVehicle::_SellWagonInternal(VehicleID vehicle_id, int wagon, bool sell_attached_wagons)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id) && wagon < GetNumWagons(vehicle_id));
EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN);
@@ -159,6 +165,7 @@
/* static */ bool ScriptVehicle::SendVehicleToDepot(VehicleID vehicle_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
return ScriptObject::DoCommand(0, vehicle_id, 0, GetCmdSendToDepot(::Vehicle::Get(vehicle_id)));
@@ -166,6 +173,7 @@
/* static */ bool ScriptVehicle::SendVehicleToDepotForServicing(VehicleID vehicle_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
return ScriptObject::DoCommand(0, vehicle_id | DEPOT_SERVICE, 0, GetCmdSendToDepot(::Vehicle::Get(vehicle_id)));
@@ -185,6 +193,7 @@
/* static */ bool ScriptVehicle::StartStopVehicle(VehicleID vehicle_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
return ScriptObject::DoCommand(0, vehicle_id, 0, CMD_START_STOP_VEHICLE);
@@ -192,6 +201,7 @@
/* static */ bool ScriptVehicle::ReverseVehicle(VehicleID vehicle_id)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_ROAD || ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN);
@@ -204,6 +214,7 @@
/* static */ bool ScriptVehicle::SetName(VehicleID vehicle_id, const char *name)
{
+ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
EnforcePrecondition(false, IsValidVehicle(vehicle_id));
EnforcePrecondition(false, !::StrEmpty(name));
EnforcePreconditionCustomError(false, ::Utf8StringLength(name) < MAX_LENGTH_VEHICLE_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
diff --git a/src/script/api/script_vehicle.hpp b/src/script/api/script_vehicle.hpp
index f9cf71876..9a6723cb9 100644
--- a/src/script/api/script_vehicle.hpp
+++ b/src/script/api/script_vehicle.hpp
@@ -117,9 +117,9 @@ public:
* @pre IsValidVehicle(vehicle_id).
* @pre 'name' must have at least one character.
* @pre 'name' must have at most 30 characters.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptError::ERR_NAME_IS_NOT_UNIQUE
* @return True if and only if the name was changed.
- * @api -game
*/
static bool SetName(VehicleID vehicle_id, const char *name);
@@ -308,6 +308,7 @@ public:
* @pre The tile at depot has a depot that can build the engine and
* is owned by you.
* @pre ScriptEngine::IsBuildable(engine_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_TOO_MANY
* @exception ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED
* @exception ScriptVehicle::ERR_VEHICLE_WRONG_DEPOT
@@ -317,7 +318,6 @@ public:
* @note In Test Mode it means you can't assign orders yet to this vehicle,
* as the vehicle isn't really built yet. Build it for real first before
* assigning orders.
- * @api -game
*/
static VehicleID BuildVehicle(TileIndex depot, EngineID engine_id);
@@ -328,13 +328,13 @@ public:
* @param share_orders Should the orders be copied or shared?
* @pre The tile 'depot' has a depot on it, allowing 'vehicle_id'-type vehicles.
* @pre IsValidVehicle(vehicle_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_TOO_MANY
* @exception ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED
* @exception ScriptVehicle::ERR_VEHICLE_WRONG_DEPOT
* @return The VehicleID of the new vehicle, or an invalid VehicleID when
* it failed. Check the return value using IsValidVehicle. In test-mode
* 0 is returned if it was successful; any other value indicates failure.
- * @api -game
*/
static VehicleID CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders);
@@ -349,8 +349,8 @@ public:
* @pre dest_vehicle_id == -1 || (IsValidVehicle(dest_vehicle_id) && dest_wagon < GetNumWagons(dest_vehicle_id)).
* @pre GetVehicleType(source_vehicle_id) == VT_RAIL.
* @pre dest_vehicle_id == -1 || GetVehicleType(dest_vehicle_id) == VT_RAIL.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether or not moving the wagon succeeded.
- * @api -game
*/
static bool MoveWagon(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon);
@@ -365,8 +365,8 @@ public:
* @pre dest_vehicle_id == -1 || (IsValidVehicle(dest_vehicle_id) && dest_wagon < GetNumWagons(dest_vehicle_id)).
* @pre GetVehicleType(source_vehicle_id) == VT_RAIL.
* @pre dest_vehicle_id == -1 || GetVehicleType(dest_vehicle_id) == VT_RAIL.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return Whether or not moving the wagons succeeded.
- * @api -game
*/
static bool MoveWagonChain(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon);
@@ -390,11 +390,11 @@ public:
* @pre ScriptCargo::IsValidCargo(cargo).
* @pre You must own the vehicle.
* @pre The vehicle must be stopped in the depot.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_REFIT
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
* @return True if and only if the refit succeeded.
- * @api -game
*/
static bool RefitVehicle(VehicleID vehicle_id, CargoID cargo);
@@ -404,10 +404,10 @@ public:
* @pre IsValidVehicle(vehicle_id).
* @pre You must own the vehicle.
* @pre The vehicle must be stopped in the depot.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
* @return True if and only if the vehicle has been sold.
- * @api -game
*/
static bool SellVehicle(VehicleID vehicle_id);
@@ -419,10 +419,10 @@ public:
* @pre wagon < GetNumWagons(vehicle_id).
* @pre You must own the vehicle.
* @pre The vehicle must be stopped in the depot.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
* @return True if and only if the wagon has been sold.
- * @api -game
*/
static bool SellWagon(VehicleID vehicle_id, int wagon);
@@ -434,10 +434,10 @@ public:
* @pre wagon < GetNumWagons(vehicle_id).
* @pre You must own the vehicle.
* @pre The vehicle must be stopped in the depot.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
* @return True if and only if the wagons have been sold.
- * @api -game
*/
static bool SellWagonChain(VehicleID vehicle_id, int wagon);
@@ -446,9 +446,9 @@ public:
* sent to a depot it continues with its normal orders instead.
* @param vehicle_id The vehicle to send to a depot.
* @pre IsValidVehicle(vehicle_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
* @return True if the current order was changed.
- * @api -game
*/
static bool SendVehicleToDepot(VehicleID vehicle_id);
@@ -457,9 +457,9 @@ public:
* already been sent to a depot it continues with its normal orders instead.
* @param vehicle_id The vehicle to send to a depot for servicing.
* @pre IsValidVehicle(vehicle_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
* @return True if the current order was changed.
- * @api -game
*/
static bool SendVehicleToDepotForServicing(VehicleID vehicle_id);
@@ -467,11 +467,11 @@ public:
* Starts or stops the given vehicle depending on the current state.
* @param vehicle_id The vehicle to start/stop.
* @pre IsValidVehicle(vehicle_id).
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_START_STOP
* @exception (For aircraft only): ScriptVehicle::ERR_VEHICLE_IN_FLIGHT
* @exception (For trains only): ScriptVehicle::ERR_VEHICLE_NO_POWER
* @return True if and only if the vehicle has been started or stopped.
- * @api -game
*/
static bool StartStopVehicle(VehicleID vehicle_id);
@@ -480,10 +480,10 @@ public:
* @param vehicle_id The vehicle to turn.
* @pre IsValidVehicle(vehicle_id).
* @pre GetVehicleType(vehicle_id) == VT_ROAD || GetVehicleType(vehicle_id) == VT_RAIL.
+ * @game @pre Valid ScriptCompanyMode active in scope.
* @return True if and only if the vehicle has started to turn.
* @note Vehicles cannot always be reversed. For example busses and trucks need to be running
* and not be inside a depot.
- * @api -game
*/
static bool ReverseVehicle(VehicleID vehicle_id);