summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorMax Maton <max@maton.info>2019-09-03 22:50:58 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-09-08 10:09:19 +0200
commite4414471dd10c3afebc49f3cc7c51f76852b08e0 (patch)
tree467646d36c4ad1a9f79ff8a175ec714a8a83d533 /src/script
parent901463386671defe899505f4dd593d1de4b90a5c (diff)
downloadopenttd-e4414471dd10c3afebc49f3cc7c51f76852b08e0.tar.xz
Add: Allow GameScript to demolish without a company
This allows GameScripts to shrink towns as well as grow them.
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/ai_changelog.hpp3
-rw-r--r--src/script/api/script_tile.cpp1
-rw-r--r--src/script/api/script_tile.hpp1
3 files changed, 3 insertions, 2 deletions
diff --git a/src/script/api/ai_changelog.hpp b/src/script/api/ai_changelog.hpp
index 5aacf8e8c..7258cf74e 100644
--- a/src/script/api/ai_changelog.hpp
+++ b/src/script/api/ai_changelog.hpp
@@ -35,6 +35,9 @@
* \li AIEngine::HasPowerOnRoad
* \li AIRoadTypeList::RoadTypeList
*
+ * Other changes:
+ * \li AITile::DemolishTile works without a selected company
+ *
* \b 1.9.0
*
* API additions:
diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp
index 3d10b7d51..0f6240666 100644
--- a/src/script/api/script_tile.cpp
+++ b/src/script/api/script_tile.cpp
@@ -262,7 +262,6 @@
/* 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);
diff --git a/src/script/api/script_tile.hpp b/src/script/api/script_tile.hpp
index f4a2f0970..2aa23bf24 100644
--- a/src/script/api/script_tile.hpp
+++ b/src/script/api/script_tile.hpp
@@ -445,7 +445,6 @@ 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.
*/