Attached Files |
0001-Make-stashes-use-FFT_NOTABLE-for-searching-for-notab.patch [^] (3,564 bytes) 2014-11-12 21:13 [Show Content] [Hide Content]From 2b713c59c97e32435d85694142cb18e385e7a3ce Mon Sep 17 00:00:00 2001
From: "Edgar A. Bering IV" <trizor@gmail.com>
Date: Wed, 12 Nov 2014 11:45:40 -0600
Subject: [PATCH 1/1] Make stashes use FFT_NOTABLE for searching for notable
terrain instead of criteria used only in the stash code.
Make runed doors notable so you can stash-search for them.
---
crawl-ref/source/feature-data.h | 2 +-
crawl-ref/source/stash.cc | 36 ++++--------------------------------
crawl-ref/source/stash.h | 2 --
3 files changed, 5 insertions(+), 35 deletions(-)
diff --git a/crawl-ref/source/feature-data.h b/crawl-ref/source/feature-data.h
index 4d7719e..2aa21e9 100644
--- a/crawl-ref/source/feature-data.h
+++ b/crawl-ref/source/feature-data.h
@@ -40,7 +40,7 @@ static feature_def feat_defs[] =
DNGN_RUNED_DOOR, "runed door", "runed_door",
DCHAR_DOOR_CLOSED, NUM_DCHAR_TYPES,
COLOUR_AND_MAP(LIGHTBLUE),
- FFT_OPAQUE | FFT_SOLID, MF_DOOR,
+ FFT_OPAQUE | FFT_SOLID | FFT_NOTABLE, MF_DOOR,
},
{
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 928bd82..9840287 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -20,6 +20,7 @@
#include "describe.h"
#include "directn.h"
#include "env.h"
+#include "feature.h"
#include "godpassive.h"
#include "hints.h"
#include "invent.h"
@@ -228,34 +229,6 @@ bool Stash::needs_stop() const
return false;
}
-bool Stash::is_boring_feature(dungeon_feature_type feature)
-{
- switch (feature)
- {
- // Discard spammy dungeon features.
- case DNGN_SHALLOW_WATER:
- case DNGN_DEEP_WATER:
- case DNGN_LAVA:
- case DNGN_OPEN_DOOR:
- case DNGN_STONE_STAIRS_DOWN_I:
- case DNGN_STONE_STAIRS_DOWN_II:
- case DNGN_STONE_STAIRS_DOWN_III:
- case DNGN_STONE_STAIRS_UP_I:
- case DNGN_STONE_STAIRS_UP_II:
- case DNGN_STONE_STAIRS_UP_III:
- case DNGN_ESCAPE_HATCH_DOWN:
- case DNGN_ESCAPE_HATCH_UP:
- case DNGN_SEALED_STAIRS_UP:
- case DNGN_SEALED_STAIRS_DOWN:
- case DNGN_ENTER_SHOP:
- case DNGN_ABANDONED_SHOP:
- case DNGN_UNDISCOVERED_TRAP:
- return true;
- default:
- return feat_is_solid(feature);
- }
-}
-
static bool _grid_has_perceived_item(const coord_def& pos)
{
return you.visible_igrd(pos) != NON_ITEM;
@@ -286,15 +259,14 @@ void Stash::update()
feat = grd(p);
trap = NUM_TRAPS;
- if (is_boring_feature(feat))
- feat = DNGN_FLOOR;
-
if (feat_is_trap(feat))
{
trap = get_trap_type(p);
if (trap == TRAP_WEB)
feat = DNGN_FLOOR, trap = TRAP_UNASSIGNED;
}
+ else if (!is_notable_terrain(feat))
+ feat = DNGN_FLOOR;
if (feat == DNGN_FLOOR)
feat_desc = "";
@@ -1620,7 +1592,7 @@ void StashTracker::update_visible_stashes()
if ((!lev || !lev->update_stash(*ri))
&& (_grid_has_perceived_item(*ri)
- || !Stash::is_boring_feature(feat)))
+ || is_notable_terrain(feat)))
{
if (!lev)
lev = &get_current_level();
diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h
index 11bc547..5cd300c 100644
--- a/crawl-ref/source/stash.h
+++ b/crawl-ref/source/stash.h
@@ -24,8 +24,6 @@ public:
Stash(int xp = -1, int yp = -1);
Stash(const Stash &other) { *this = other; };
- static bool is_boring_feature(dungeon_feature_type feat);
-
static string stash_item_name(const item_def &item);
void update();
bool unmark_trapping_nets();
--
1.9.3 (Apple Git-50)
|