summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgn.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-30 23:19:16 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-30 23:23:59 +1000
commitc5ae9840ae67e1f2a7dee0edcd6a63c5768fcdf6 (patch)
tree46bd8e0e46cbb3a522d68fe0127e7194eb3a50b1 /crawl-ref/source/l_dgn.cc
parent6f06963cd90a07d112d7a41e057f8076e250d28c (diff)
downloadcrawl-ref-c5ae9840ae67e1f2a7dee0edcd6a63c5768fcdf6.tar.gz
crawl-ref-c5ae9840ae67e1f2a7dee0edcd6a63c5768fcdf6.zip
Revert "Convert dgn.set_border_fill_type to BORDER."
This reverts commit 941444076c26e5e5149c6368a4261d60842fe3ec. After consultation with Enne, this doesn't really fix the issue, and is therefore superfluous.
Diffstat (limited to 'crawl-ref/source/l_dgn.cc')
-rw-r--r--crawl-ref/source/l_dgn.cc54
1 files changed, 27 insertions, 27 deletions
diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc
index 56a4ba6256..422270dbc3 100644
--- a/crawl-ref/source/l_dgn.cc
+++ b/crawl-ref/source/l_dgn.cc
@@ -773,32 +773,6 @@ static int dgn_get_rock_colour(lua_State *ls)
PLUARET(string, colour_to_str(env.rock_colour).c_str());
}
-bool _valid_border_feat (dungeon_feature_type feat)
-{
- return ((feat <= DNGN_MAXWALL && feat >= DNGN_MINWALL)
- || (feat == DNGN_TREES || feat == DNGN_OPEN_SEA
- || feat == DNGN_LAVA || feat == DNGN_DEEP_WATER
- || feat == DNGN_SHALLOW_WATER || feat == DNGN_FLOOR));
-}
-
-static int dgn_border(lua_State *ls)
-{
- MAP(ls, 1, map);
- if (lua_gettop(ls) != 2)
- luaL_error(ls, "set_border_fill_type requires a feature.");
-
- std::string fill_string = luaL_checkstring(ls, 2);
- dungeon_feature_type fill_type = dungeon_feature_by_name(fill_string);
-
- if (_valid_border_feat(fill_type))
- map->border_fill_type = fill_type;
- else
- luaL_error(ls, ("set_border_fill_type cannot be the feature '" +
- fill_string +"'.").c_str());
-
- PLUARET(string, dungeon_feature_name(map->border_fill_type));
-}
-
static int _lua_colour(lua_State *ls, int ndx,
int forbidden_colour = -1)
{
@@ -946,6 +920,32 @@ static int lua_dgn_set_lt_callback(lua_State *ls)
return (0);
}
+bool _valid_border_feat (dungeon_feature_type feat)
+{
+ return ((feat <= DNGN_MAXWALL && feat >= DNGN_MINWALL)
+ || (feat == DNGN_TREES || feat == DNGN_OPEN_SEA
+ || feat == DNGN_LAVA || feat == DNGN_DEEP_WATER
+ || feat == DNGN_SHALLOW_WATER || feat == DNGN_FLOOR));
+}
+
+static int lua_dgn_set_border_fill_type (lua_State *ls)
+{
+ MAP(ls, 1, map);
+ if (lua_gettop(ls) != 2)
+ luaL_error(ls, "set_border_fill_type requires a feature.");
+
+ std::string fill_string = luaL_checkstring(ls, 2);
+ dungeon_feature_type fill_type = dungeon_feature_by_name(fill_string);
+
+ if (_valid_border_feat(fill_type))
+ map->border_fill_type = fill_type;
+ else
+ luaL_error(ls, ("set_border_fill_type cannot be the feature '" +
+ fill_string +"'.").c_str());
+
+ return (0);
+}
+
static int dgn_fixup_stairs(lua_State *ls)
{
const dungeon_feature_type up_feat =
@@ -1711,7 +1711,6 @@ const struct luaL_reg dgn_dlib[] =
{ "colour", dgn_colour },
{ "lfloorcol", dgn_lfloorcol},
{ "lrockcol", dgn_lrockcol},
-{ "border", dgn_border},
{ "normalise", dgn_normalise },
{ "map", dgn_map },
{ "mons", dgn_mons },
@@ -1747,6 +1746,7 @@ const struct luaL_reg dgn_dlib[] =
{ "change_floor_colour", dgn_change_floor_colour },
{ "change_rock_colour", dgn_change_rock_colour },
{ "set_lt_callback", lua_dgn_set_lt_callback },
+{ "set_border_fill_type", lua_dgn_set_border_fill_type },
{ "fixup_stairs", dgn_fixup_stairs },
{ "floor_halo", dgn_floor_halo },
{ "random_walk", dgn_random_walk },