diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-10 18:02:36 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-10 18:02:36 +0000 |
commit | 99ef5025371298f36f248ba83fa07d3d7b9f550b (patch) | |
tree | 53b69ef9cbb12936bf69552fb042ba74458122fd | |
parent | 682d6e0d64bbda8084e867ebc887befabd75a51f (diff) | |
download | crawl-ref-99ef5025371298f36f248ba83fa07d3d7b9f550b.tar.gz crawl-ref-99ef5025371298f36f248ba83fa07d3d7b9f550b.zip |
Fixed Lua userdata leak and detected_item_colour bug for 0.3.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2409 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/clua.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index dd6fe05a9a..5455b857f1 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -1829,8 +1829,8 @@ static int crawl_regex_find(lua_State *ls) static int crawl_regex_gc(lua_State *ls) { - text_pattern **pattern = - clua_get_userdata< text_pattern* >(ls, REGEX_METATABLE); + text_pattern **pattern = + static_cast<text_pattern **>( lua_touserdata(ls, 1) ); if (pattern) delete *pattern; return (0); @@ -1879,8 +1879,8 @@ static int crawl_messf_matches(lua_State *ls) static int crawl_messf_gc(lua_State *ls) { - message_filter **pattern = - clua_get_userdata< message_filter* >(ls, REGEX_METATABLE); + message_filter **pattern = + static_cast<message_filter**>( lua_touserdata(ls, 1) ); if (pattern) delete *pattern; return (0); diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 3a0a57581d..dbb211a3e6 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -521,7 +521,7 @@ screen_buffer_t colour_code_map( int x, int y, bool item_colour, : DARKGREY; if (map_flags & MAP_DETECTED_ITEM) - tc = Options.detected_item_colour; + return real_colour(Options.detected_item_colour); if (map_flags & MAP_DETECTED_MONSTER) { @@ -529,9 +529,9 @@ screen_buffer_t colour_code_map( int x, int y, bool item_colour, return real_colour(tc); } - // XXX: [ds] If we've an important colour, override other feature - // colouring. Yes, this is hacky. Story of my life. - if (tc == LIGHTGREEN || tc == LIGHTMAGENTA) + // If this is an important travel square, don't allow the colour + // to be overridden. + if (is_waypoint(x, y) || travel_point_distance[x][y] == PD_EXCLUDED) return real_colour(tc); if (item_colour && is_envmap_item(x, y)) |