summaryrefslogtreecommitdiff
path: root/src/script/api/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-04-30 17:16:32 +0000
committerrubidium <rubidium@openttd.org>2013-04-30 17:16:32 +0000
commit5730e63a10f8edfe2b1495242f19b9b60589a4e2 (patch)
treed76689f8ad86c50720c67c76544f09ee2238c76a /src/script/api/ai
parent5b55afb7bd21ae6fc1cc6480aac2946262d63684 (diff)
downloadopenttd-5730e63a10f8edfe2b1495242f19b9b60589a4e2.tar.xz
(svn r25213) -Fix [FS#5537]: clarify on which tiles IsDesertTile and IsSnowTile work, i.e. the ones without infrastructure or buildings
-Feature: introduce GetTerrainType which allows one to get that information for tiles with buildings and infrastructure as well
Diffstat (limited to 'src/script/api/ai')
-rw-r--r--src/script/api/ai/ai_tile.hpp.sq5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/api/ai/ai_tile.hpp.sq b/src/script/api/ai/ai_tile.hpp.sq
index 44d5e326c..570e88cd2 100644
--- a/src/script/api/ai/ai_tile.hpp.sq
+++ b/src/script/api/ai/ai_tile.hpp.sq
@@ -66,6 +66,10 @@ void SQAITile_Register(Squirrel *engine)
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_ROCKY, "BT_CLEAR_ROCKY");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_FIELDS, "BT_CLEAR_FIELDS");
SQAITile.DefSQConst(engine, ScriptTile::BT_CLEAR_HOUSE, "BT_CLEAR_HOUSE");
+ SQAITile.DefSQConst(engine, ScriptTile::TERRAIN_NORMAL, "TERRAIN_NORMAL");
+ SQAITile.DefSQConst(engine, ScriptTile::TERRAIN_DESERT, "TERRAIN_DESERT");
+ SQAITile.DefSQConst(engine, ScriptTile::TERRAIN_RAINFOREST, "TERRAIN_RAINFOREST");
+ SQAITile.DefSQConst(engine, ScriptTile::TERRAIN_SNOW, "TERRAIN_SNOW");
ScriptError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, ScriptTile::ERR_TILE_TOO_HIGH);
ScriptError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, ScriptTile::ERR_TILE_TOO_LOW);
@@ -90,6 +94,7 @@ void SQAITile_Register(Squirrel *engine)
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsRoughTile, "IsRoughTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsSnowTile, "IsSnowTile", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::IsDesertTile, "IsDesertTile", 2, ".i");
+ SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetTerrainType, "GetTerrainType", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetSlope, "GetSlope", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetComplementSlope, "GetComplementSlope", 2, ".i");
SQAITile.DefSQStaticMethod(engine, &ScriptTile::GetMinHeight, "GetMinHeight", 2, ".i");