summaryrefslogtreecommitdiff
path: root/src/script/api/template
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/template
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/template')
-rw-r--r--src/script/api/template/template_tile.hpp.sq2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/api/template/template_tile.hpp.sq b/src/script/api/template/template_tile.hpp.sq
index 8897e8c55..e78aaa6ac 100644
--- a/src/script/api/template/template_tile.hpp.sq
+++ b/src/script/api/template/template_tile.hpp.sq
@@ -23,6 +23,8 @@ namespace SQConvert {
template <> inline int Return<ScriptTile::TransportType>(HSQUIRRELVM vm, ScriptTile::TransportType res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptTile::BuildType GetParam(ForceType<ScriptTile::BuildType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::BuildType)tmp; }
template <> inline int Return<ScriptTile::BuildType>(HSQUIRRELVM vm, ScriptTile::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
+ template <> inline ScriptTile::TerrainType GetParam(ForceType<ScriptTile::TerrainType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptTile::TerrainType)tmp; }
+ template <> inline int Return<ScriptTile::TerrainType>(HSQUIRRELVM vm, ScriptTile::TerrainType res) { sq_pushinteger(vm, (int32)res); return 1; }
/* Allow ScriptTile to be used as Squirrel parameter */
template <> inline ScriptTile *GetParam(ForceType<ScriptTile *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTile *)instance; }