diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-11-19 17:08:15 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-11-19 17:15:50 +0100 |
commit | 5808442128655af029413add3605fb18e666bf07 (patch) | |
tree | 99ac17382a7cd8f180cc67c44bfca7891d63c7b8 /crawl-ref/source/l_dgntil.cc | |
parent | c6bafeca0673e50cdeb6308c2790ada29ea9d9fe (diff) | |
download | crawl-ref-5808442128655af029413add3605fb18e666bf07.tar.gz crawl-ref-5808442128655af029413add3605fb18e666bf07.zip |
Fix portal vaults' "floor_tile" not working for actual floor.
There are two distinct layers, the non-floor one now uses "feat_tile".
I did not change the misnamed "floor" argument yet.
Diffstat (limited to 'crawl-ref/source/l_dgntil.cc')
-rw-r--r-- | crawl-ref/source/l_dgntil.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/crawl-ref/source/l_dgntil.cc b/crawl-ref/source/l_dgntil.cc index beaa39195f..0737289963 100644 --- a/crawl-ref/source/l_dgntil.cc +++ b/crawl-ref/source/l_dgntil.cc @@ -206,6 +206,37 @@ LUAFN(dgn_tile_feat_changed) return (0); } +LUAFN(dgn_tile_floor_changed) +{ +#ifdef USE_TILE + COORDS(c, 1, 2); + + if (lua_isnil(ls, 3)) + { + env.tile_flv(c).floor = 0; + env.tile_flv(c).floor_idx = 0; + return (0); + } + + std::string tilename = luaL_checkstring(ls, 3); + + tileidx_t floor; + if (!tile_dngn_index(tilename.c_str(), &floor)) + { + std::string error = "Couldn't find tile '"; + error += tilename; + error += "'"; + luaL_argerror(ls, 1, error.c_str()); + return 0; + } + env.tile_flv(c).floor = floor; + env.tile_flv(c).floor_idx = + store_tilename_get_index(tilename); +#endif + + return (0); +} + const struct luaL_reg dgn_tile_dlib[] = { { "lrocktile", dgn_lrocktile }, @@ -218,6 +249,7 @@ const struct luaL_reg dgn_tile_dlib[] = { "lev_floortile", dgn_lev_floortile }, { "lev_rocktile", dgn_lev_rocktile }, { "tile_feat_changed", dgn_tile_feat_changed }, +{ "tile_floor_changed", dgn_tile_floor_changed }, { NULL, NULL } }; |