summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-23 15:45:50 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-23 15:45:50 +0000
commit4a27e1a50d859e3e97c2ecd06cdd0a995a9a6977 (patch)
tree50feb8a507fdfbb3d9e2ec905c45d35dda3080b4
parent2e311420c5089f3afc366b6808e724a6a997788c (diff)
downloadcrawl-ref-4a27e1a50d859e3e97c2ecd06cdd0a995a9a6977.tar.gz
crawl-ref-4a27e1a50d859e3e97c2ecd06cdd0a995a9a6977.zip
More branch entry vaults (Erik).
Changed behaviour when using KMONS and KITEM without a corresponding KFEAT. Previously this would force the dungeon feature of that square to plain floor. The new behaviour is to try to map the glyph to itself. For instance: KMONS: O = pandemonium demon will place a pandemonium demon on the rune, whereas previously it would place the pan demon on a floor square. Tossed out old waypoint hacks. Waypoints are now handled in the same way as travel to stash search places. This ought to fix the waypoint corruption issues. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1081 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/dat/splev.des198
-rw-r--r--crawl-ref/source/dungeon.cc12
-rw-r--r--crawl-ref/source/enum.h93
-rw-r--r--crawl-ref/source/mapdef.cc23
-rw-r--r--crawl-ref/source/mapdef.h6
-rw-r--r--crawl-ref/source/travel.cc144
-rw-r--r--crawl-ref/source/travel.h18
7 files changed, 241 insertions, 253 deletions
diff --git a/crawl-ref/source/dat/splev.des b/crawl-ref/source/dat/splev.des
index 9f9b2c59dd..bc660d38f6 100644
--- a/crawl-ref/source/dat/splev.des
+++ b/crawl-ref/source/dat/splev.des
@@ -2586,6 +2586,125 @@ MAP
ENDMAP
##############################################################################
+# Caught partying
+
+NAME: erik_orc_1
+TAGS: orc_entry
+MONS: orc, orc priest/orc wizard, weight:50 orc warrior/ogre, swamp drake
+# The drake's name is Bobby. Since you did ask.
+KITEM: 1 = sausage / nothing / animal skin / potion of confusion / potion of paralysis / potion of slowing / potion of degeneration / weight:2 potion of speed / weight:2 potion of might
+ITEM: club, potion of confusion, slice of pizza, sausage / weight:40 nothing, potion of confusion / potion of water
+SHUFFLE: defO
+FLAGS: no_rotate
+ORIENT: float
+MAP
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+x.........g..........2x...w4xxx
+x.....1...32...1......x1...wxxx
+x.........xx.....e..........xxx
+@.......f...1g............3.x$x
+x..x1.................O...x.xhx
+x..x1...1........2..1....gx.xhx
+x......2....g.........d.1.x1+hx
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ENDMAP
+
+##############################################################################
+# C'mon, you *gotta* have a *fort*!
+
+NAME: erik_orc_2
+TAGS: orc_entry no_pool_fixup
+MONS: orc warrior, orc priest/orc wizard, weight:100 orc / orc warrior, weight:100 orc knight / orc warrior
+ORIENT: float
+FLAGS: no_rotate
+SUBST: c = c:1000 x
+MAP
+.............................
+.Iwwwwwwwwwwwwwwwwwwwwwwwwww.
+.wIwwwwwwwwwwwwwwwwwwwwwwwww.
+.ww2ccccccccccccccccccccccww.
+.ww.c.......3.3.3......w2cww.
+.wwxx........3.3.......wwcww.
+.122........3.I.3......4Ocww.
+.wwxx........3.3.......wwcww.
+.ww.c.......3.3.3......w2cww.
+.ww2ccccccccccccccccccccccww.
+.wIwwwwwwwwwwwwwwwwwwwwwwwww.
+.Iwwwwwwwwwwwwwwwwwwwwwwwwww.
+.............................
+ENDMAP
+
+
+##############################################################################
+# Just like home
+
+NAME: erik_orc_3
+TAGS: orc_entry
+MONS: orc / weight:2 goblin / weight:2 hobgoblin / nothing, orc warrior / orc priest / orc wizard / nothing, warg / ogre / nothing
+ORIENT: float
+SUBST: ? = x . $:1
+# too bad there's no no_item_gen tag
+
+MAP
+xxx.xxxxxxxxxxxxxxxxxxx
+xxx?.x?x?xx?xxx??xx?xxx
+xx..xxx..1.xxx....13xxx
+xx.x??x.x1xx?x.21xx?..x
+xx...x..xxx.2..1.x.x??.
+xx?x.....?x.x..x.x1?.xx
+xx..??12x?x.1.1?x.x??xx
+xxx..x..x??O<x..x.xx.xx
+x?..?x......x?.x.??x.xx
+xx.x??.x.x..?x..xx.x?xx
+x?xx?xx.x??...x.1x.1??x
+xx..xxx...x.x.x.1?1.xxx
+x?.2....xx2.x...xx.x??x
+xxx??xx..xx.xx.x?..xxxx
+xx..1.x.x.3...x2.x1..xx
+..x??x.xxx..xxxx??.??xx
+xx?.??.11.x?xxx..x..xxx
+x??xxxx???xx?xxx??x.?xx
+xxxxxxxxxxxxxxxxxxxx.xx
+ENDMAP
+
+##############################################################################
+# Orc-henge
+
+NAME: erik_orc_4
+TAGS: orc_entry
+MONS: human/goblin/hobgoblin/weight:2 orc, orc priest, orc
+MONS: orc priest/orc wizard/weight:2 goblin/nothing, orc warrior/warg
+ORIENT: float
+SUBST: ? : c:20 .
+SUBST: Z : c:20 .
+SUBST: X : c:20 .
+SUBST: v : c:20 .
+SUBST: b : c:20 .
+KITEM: 2 = knife
+
+MAP
+..............................
+...............ZZ.............
+.........??....ZZ....vv.......
+.........??..........vv.......
+....XX.......33533............
+....XX........1.2........bb...
+.........4....xxx...4....bb...
+.............33533............
+..bb..........................
+..bb...........O..........??..
+........4.............4...??..
+..................4...........
+...ZZ.........................
+...ZZ......4............vv....
+........................vv....
+.......cc..........vv.........
+.......cc....??....vv.........
+.............??...............
+..............................
+ENDMAP
+
+##############################################################################
# Vaults entries
##############################################################################
# Dummy Vaults entry
@@ -2727,7 +2846,6 @@ ORIENT: float
SHUFFLE: 124w
SHUFFLE: cG
SUBST: ? = %.
-KFEAT: O = O
KMONS: O = oklob plant
MAP
@@ -2905,3 +3023,81 @@ MAP
.............
1...@.......1
ENDMAP
+
+##############################################################################
+# Bears Won't Share
+
+NAME: erik_hive_1
+TAGS: hive_entry
+MONS: weight:200 bear/polar bear, grizzly bear, black bear, killer bee, queen bee, killer bee larva
+ITEM: honeycomb, royal jelly
+SHUFFLE: 123
+SHUFFLE: deO
+ORIENT: float
+
+MAP
+.......................
+.............aaa.......
+...........aaa4aaaaa...
+...........a4e6d564a...
+......2....a6.4.4O6a...
+............a64aa4a....
+....1.......aaaaaa.....
+.......3...............
+.......................
+ENDMAP
+
+
+##############################################################################
+# Bucolic
+NAME: erik_hive_2
+TAGS: hive_entry
+MONS: plant, killer bee
+SUBST: 1 = 1.
+SUBST: 2 = 2.
+ORIENT: float
+MAP
+.....................
+.1.....2.......1.1...
+...1.....1...2..1....
+.....2.........1.....
+.1.2....1....2.....2.
+......2.....1....21..
+.1...1...1...........
+.....2.....1.21...2..
+.......1.O......21...
+...1.......1.........
+...2.....1....1..2...
+.....11.2....2...11..
+...1..1....1.........
+....2.......2....1...
+....1...1.....1......
+.....................
+ENDMAP
+
+
+##############################################################################
+# Object lesson
+NAME: erik_hive_3
+TAGS: hive_entry
+MONS: killer bee larva, killer bee, queen bee, firedrake
+SUBST: l = l.
+ORIENT: float
+
+MAP
+..................
+...aaaaa..........
+..aaRa....a...a...
+..a2.a.aaa=.aa....
+.aa.1aaa.1aaa...a.
+..aa21.2O2aaa4.aa.
+...aaa2131aaaaa...
+..aaaaaRaaa..aa...
+..aa.4aaa.a...a...
+.aa...aaa.aa......
+.a..aaaa..........
+......a..a.llllll.
+.......aaa.llllll.
+...........llllll.
+..................
+ENDMAP
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 959aa7d6ff..83d69a5086 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -6005,6 +6005,14 @@ static void dngn_place_item_explicit(const item_spec &spec,
}
}
+static void dngn_place_multiple_items(item_list &list,
+ int x, int y, int level)
+{
+ const int size = list.size();
+ for (int i = 0; i < size; ++i)
+ dngn_place_item_explicit(list.get_item(i), x, y, level);
+}
+
static void dngn_place_item_explicit(int index, int x, int y,
vault_placement &place,
int level)
@@ -6099,8 +6107,8 @@ static int vault_grid( vault_placement &place,
mons_spec mons = mapsp->get_mons();
dngn_place_monster(mons, level_number, vx, vy);
- item_spec item = mapsp->get_item();
- dngn_place_item_explicit(item, vx, vy, level_number);
+ item_list &items = mapsp->get_items();
+ dngn_place_multiple_items(items, vx, vy, level_number);
return (altar_count);
}
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index eedb9dd0b4..a550facf69 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -3663,99 +3663,6 @@ enum unique_item_status_type
UNIQ_LOST_IN_ABYSS = 2
};
-// NOTE: THE ORDER AND VALUE OF THESE IS CURRENTLY VERY IMPORTANT!
-enum vault_type
-{
- VAULT_VAULT_1 = 0,
- VAULT_VAULT_2 = 1,
- VAULT_VAULT_3 = 2,
- VAULT_VAULT_4 = 3,
- VAULT_VAULT_5 = 4,
- VAULT_VAULT_6 = 5,
- VAULT_VAULT_7 = 6,
- VAULT_VAULT_8 = 7,
- VAULT_VAULT_9 = 8,
- VAULT_VAULT_10 = 9,
- VAULT_ORC_TEMPLE = 10,
- VAULT_FARM_AND_COUNTRY = 11,
- VAULT_FORT_YAKTAUR = 12,
- VAULT_BOX_LEVEL = 13,
- VAULT_MY_MAP = 14,
-
- VAULT_VESTIBULE_MAP = 50,
- VAULT_CASTLE_DIS = 51,
- VAULT_ASMODEUS = 52,
- VAULT_ANTAEUS = 53,
- VAULT_ERESHKIGAL = 54,
-
- VAULT_MNOLEG = 60,
- VAULT_LOM_LOBON = 61,
- VAULT_CEREBOV = 62,
- VAULT_GLOORX_VLOQ = 63,
- // VAULT_MOLLUSC = 64,
-
- VAULT_BEEHIVE = 80,
- VAULT_SLIME_PIT = 81,
- VAULT_BOTTOM_OF_VAULTS = 82,
- VAULT_HALL_OF_BLADES = 83,
- VAULT_HALL_OF_ZOT = 84,
- VAULT_TEMPLE = 85,
- VAULT_SNAKE_PIT = 86,
- VAULT_ELF_HALL = 87,
- VAULT_TOMB_1 = 88,
- VAULT_TOMB_2 = 89,
- VAULT_TOMB_3 = 90,
- VAULT_SWAMP = 91,
-
- VAULT_RANDOM = 100,
-
- VAULT_MINIVAULT_1 = 200,
- VAULT_MINIVAULT_2 = 201,
- VAULT_MINIVAULT_3 = 202,
- VAULT_MINIVAULT_4 = 203,
- VAULT_MINIVAULT_5 = 204,
- VAULT_MINIVAULT_6 = 205,
- VAULT_MINIVAULT_7 = 206,
- VAULT_MINIVAULT_8 = 207,
- VAULT_MINIVAULT_9 = 208,
- VAULT_MINIVAULT_10 = 209,
- VAULT_MINIVAULT_11 = 210,
- VAULT_MINIVAULT_12 = 211,
- VAULT_MINIVAULT_13 = 212,
- VAULT_MINIVAULT_14 = 213,
- VAULT_MINIVAULT_15 = 214,
- VAULT_MINIVAULT_16 = 215,
- VAULT_MINIVAULT_17 = 216,
- VAULT_MINIVAULT_18 = 217,
- VAULT_MINIVAULT_19 = 218,
- VAULT_MINIVAULT_20 = 219,
- VAULT_MINIVAULT_21 = 220,
- VAULT_MINIVAULT_22 = 221,
- VAULT_MINIVAULT_23 = 222,
- VAULT_MINIVAULT_24 = 223,
- VAULT_MINIVAULT_25 = 224,
- VAULT_MINIVAULT_26 = 225,
- VAULT_MINIVAULT_27 = 226,
- VAULT_MINIVAULT_28 = 227,
- VAULT_MINIVAULT_29 = 228,
- VAULT_MINIVAULT_30 = 229,
- VAULT_MINIVAULT_31 = 230,
- VAULT_MINIVAULT_32 = 231,
- VAULT_MINIVAULT_33 = 232,
- VAULT_MINIVAULT_34 = 233,
- VAULT_MINIVAULT_35 = 234,
-
- VAULT_RAND_DEMON_1 = 300,
- VAULT_RAND_DEMON_2 = 301,
- VAULT_RAND_DEMON_3 = 302,
- VAULT_RAND_DEMON_4 = 303,
- VAULT_RAND_DEMON_5 = 304,
- VAULT_RAND_DEMON_6 = 305,
- VAULT_RAND_DEMON_7 = 306,
- VAULT_RAND_DEMON_8 = 307,
- VAULT_RAND_DEMON_9 = 308
-};
-
enum vorpal_damage_type
{
// Types of damage a weapon can do... currently assuming that anything
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index f247685c90..b121b361fa 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -763,6 +763,7 @@ std::string map_def::add_key_field(
return (err);
keyed_mapspec &km = keyspecs[key];
+ km.key_glyph = key;
return ((km.*set_field)(arg, separator == ':'));
}
@@ -1174,7 +1175,7 @@ int subst_spec::value()
// keyed_mapspec
keyed_mapspec::keyed_mapspec()
- : feat(), item(), mons()
+ : key_glyph(-1), feat(), item(), mons()
{
}
@@ -1292,7 +1293,7 @@ std::string keyed_mapspec::set_item(const std::string &s, bool fix)
feature_spec keyed_mapspec::get_feat()
{
- return feat.get_feat();
+ return feat.get_feat(key_glyph);
}
mons_spec keyed_mapspec::get_mons()
@@ -1300,14 +1301,9 @@ mons_spec keyed_mapspec::get_mons()
return (mons.size()? mons.get_monster(0) : mons_spec(-1));
}
-item_spec keyed_mapspec::get_item()
+item_list &keyed_mapspec::get_items()
{
- if (item.size())
- return item.get_item(0);
-
- item_spec spec;
- spec.base_type = OBJ_UNASSIGNED;
- return (spec);
+ return (item);
}
//////////////////////////////////////////////////////////////////////////
@@ -1317,10 +1313,17 @@ feature_slot::feature_slot() : feats(), fix_slot(false)
{
}
-feature_spec feature_slot::get_feat()
+feature_spec feature_slot::get_feat(int def_glyph)
{
int tweight = 0;
feature_spec chosen_feat = feature_spec(DNGN_FLOOR);
+
+ if (def_glyph != -1)
+ {
+ chosen_feat.feat = -1;
+ chosen_feat.glyph = def_glyph;
+ }
+
for (int i = 0, size = feats.size(); i < size; ++i)
{
const feature_spec &feat = feats[i];
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h
index 278bf6bbed..5c5ec9b810 100644
--- a/crawl-ref/source/mapdef.h
+++ b/crawl-ref/source/mapdef.h
@@ -250,12 +250,14 @@ struct feature_slot
bool fix_slot;
feature_slot();
- feature_spec get_feat();
+ feature_spec get_feat(int default_glyph);
};
struct keyed_mapspec
{
public:
+ int key_glyph;
+
feature_slot feat;
item_list item;
mons_list mons;
@@ -269,7 +271,7 @@ public:
feature_spec get_feat();
mons_spec get_mons();
- item_spec get_item();
+ item_list &get_items();
private:
std::string err;
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 794e07e41c..19299a1506 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -2628,36 +2628,6 @@ void stair_info::load(FILE *file)
guessed_pos = readByte(file) != 0;
}
-LevelInfo::LevelInfo(const LevelInfo &other)
-{
- stairs = other.stairs;
- excludes = other.excludes;
- int sz = stairs.size() * stairs.size();
- stair_distances = new short [ sz ];
- if (other.stair_distances)
- memcpy(stair_distances, other.stair_distances, sz * sizeof(int));
-}
-
-const LevelInfo &LevelInfo::operator = (const LevelInfo &other)
-{
- if (&other == this)
- return *this;
-
- stairs = other.stairs;
- excludes = other.excludes;
- int sz = stairs.size() * stairs.size();
- delete [] stair_distances;
- stair_distances = new short [ sz ];
- if (other.stair_distances)
- memcpy(stair_distances, other.stair_distances, sz * sizeof(short));
- return *this;
-}
-
-LevelInfo::~LevelInfo()
-{
- delete [] stair_distances;
-}
-
void LevelInfo::set_level_excludes()
{
curr_excludes = excludes;
@@ -2688,7 +2658,7 @@ void LevelInfo::update_stair_distances()
// For each stair, we need to ask travel to populate the distance
// array.
find_travel_pos(stairs[s].position.x, stairs[s].position.y,
- NULL, NULL, NULL);
+ NULL, NULL, NULL);
for (int other = 0; other < end; ++other)
{
@@ -2793,58 +2763,14 @@ int LevelInfo::get_stair_index(const coord_def &pos) const
return -1;
}
-void LevelInfo::add_waypoint(const coord_def &pos)
-{
- if (pos.x < 0 || pos.y < 0) return;
-
- // First, make sure we don't already have this position in our stair list.
- for (int i = 0, sz = stairs.size(); i < sz; ++i)
- if (stairs[i].position == pos)
- return;
-
- stair_info si;
- si.position = pos;
- si.destination.id.depth = -2; // Magic number for waypoints.
-
- stairs.push_back(si);
-
- delete [] stair_distances;
- stair_distances = new short [ stairs.size() * stairs.size() ];
-
- update_stair_distances();
-}
-
-void LevelInfo::remove_waypoint(const coord_def &pos)
-{
- for (std::vector<stair_info>::iterator i = stairs.begin();
- i != stairs.end(); ++i)
- {
- if (i->position == pos && i->destination.id.depth == -2)
- {
- stairs.erase(i);
- break;
- }
- }
-
- delete [] stair_distances;
- stair_distances = new short [ stairs.size() * stairs.size() ];
-
- update_stair_distances();
-}
-
void LevelInfo::correct_stair_list(const std::vector<coord_def> &s)
{
- // If we have a waypoint on this level, we'll always delete stair_distances
- delete [] stair_distances;
- stair_distances = NULL;
+ stair_distances.clear();
// First we kill any stairs in 'stairs' that aren't there in 's'.
for (std::vector<stair_info>::iterator i = stairs.begin();
i != stairs.end(); ++i)
{
- // Waypoints are not stairs, so we skip them.
- if (i->destination.id.depth == -2) continue;
-
bool found = false;
for (int j = s.size() - 1; j >= 0; --j)
{
@@ -2891,7 +2817,7 @@ void LevelInfo::correct_stair_list(const std::vector<coord_def> &s)
}
}
- stair_distances = new short [ stairs.size() * stairs.size() ];
+ stair_distances.reserve( stairs.size() * stairs.size() );
}
int LevelInfo::distance_between(const stair_info *s1, const stair_info *s2)
@@ -2950,25 +2876,6 @@ bool LevelInfo::is_known_branch(unsigned char branch) const
return false;
}
-void LevelInfo::travel_to_waypoint(const coord_def &pos)
-{
- stair_info *target = get_stair(pos);
- if (!target) return;
-
- curr_stairs.clear();
- for (int i = 0, sz = stairs.size(); i < sz; ++i)
- {
- if (stairs[i].destination.id.depth == -2) continue;
-
- stair_info si = stairs[i];
- si.distance = distance_between(target, &stairs[i]);
-
- curr_stairs.push_back(si);
- }
-
- start_translevel_travel(false);
-}
-
void LevelInfo::save(FILE *file) const
{
int stair_count = stairs.size();
@@ -2979,10 +2886,14 @@ void LevelInfo::save(FILE *file) const
if (stair_count)
{
- // XXX Assert stair_distances != NULL?
// Save stair distances as short ints.
for (int i = stair_count * stair_count - 1; i >= 0; --i)
- writeShort(file, stair_distances[i]);
+ {
+ if (i >= (int) stair_distances.size())
+ writeShort(file, -1);
+ else
+ writeShort(file, stair_distances[i]);
+ }
}
writeShort(file, excludes.size());
@@ -3015,10 +2926,10 @@ void LevelInfo::load(FILE *file)
if (stair_count)
{
- delete [] stair_distances;
- stair_distances = new short [ stair_count * stair_count ];
+ stair_distances.clear();
+ stair_distances.reserve(stair_count * stair_count);
for (int i = stair_count * stair_count - 1; i >= 0; --i)
- stair_distances[i] = readShort(file);
+ stair_distances.push_back( readShort(file) );
}
excludes.clear();
@@ -3054,13 +2965,7 @@ void TravelCache::travel_to_waypoint(int num)
if (num < 0 || num >= TRAVEL_WAYPOINT_COUNT) return;
if (waypoints[num].id.depth == -1) return;
- travel_target = waypoints[num];
-
- set_trans_travel_dest(trans_travel_dest, sizeof trans_travel_dest,
- travel_target);
-
- LevelInfo &li = get_level_info(travel_target.id);
- li.travel_to_waypoint(travel_target.pos);
+ start_translevel_travel(waypoints[num]);
}
void TravelCache::list_waypoints() const
@@ -3142,26 +3047,6 @@ void TravelCache::add_waypoint(int x, int y)
int waynum = keyin - '0';
- if (waypoints[waynum].is_valid())
- {
- bool unique_waypoint = true;
- for (int i = 0; i < TRAVEL_WAYPOINT_COUNT; ++i)
- {
- if (i == waynum) continue;
- if (waypoints[waynum] == waypoints[i])
- {
- unique_waypoint = false;
- break;
- }
- }
-
- if (unique_waypoint)
- {
- LevelInfo &li = get_level_info(waypoints[waynum].id);
- li.remove_waypoint(waypoints[waynum].pos);
- }
- }
-
if (x == -1 || y == -1)
{
x = you.x_pos;
@@ -3170,9 +3055,6 @@ void TravelCache::add_waypoint(int x, int y)
const coord_def pos(x, y);
const level_id &lid = level_id::current();
- LevelInfo &li = get_level_info(lid);
- li.add_waypoint(pos);
-
waypoints[waynum].id = lid;
waypoints[waynum].pos = pos;
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 1490f9df56..d60311b07c 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -301,15 +301,9 @@ struct stair_info
// Information on a level that interlevel travel needs.
struct LevelInfo
{
- LevelInfo() : stairs()
+ LevelInfo() : stairs(), excludes(), stair_distances(), id()
{
- stair_distances = NULL;
}
- LevelInfo(const LevelInfo &li);
-
- ~LevelInfo();
-
- const LevelInfo &operator = (const LevelInfo &other);
void save(FILE *) const;
void load(FILE *);
@@ -345,10 +339,6 @@ struct LevelInfo
// current level.
bool is_known_branch(unsigned char branch) const;
- void add_waypoint(const coord_def &pos);
- void remove_waypoint(const coord_def &pos);
-
- void travel_to_waypoint(const coord_def &pos);
private:
// Gets a list of coordinates of all player-known stairs on the current
// level.
@@ -366,7 +356,7 @@ private:
// Squares that are not safe to travel to.
std::vector<coord_def> excludes;
- short *stair_distances; // Distances between the various stairs
+ std::vector<short> stair_distances; // Dist between stairs
level_id id;
friend class TravelCache;
@@ -491,8 +481,8 @@ protected:
void good_square(const coord_def &c);
protected:
- static const int UNFOUND_DIST = -10000;
- static const int INFINITE_DIST = 10000;
+ static const int UNFOUND_DIST = -30000;
+ static const int INFINITE_DIST = 30000;
protected:
run_mode_type runmode;