diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-30 10:53:06 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-30 10:53:06 +0000 |
commit | 262b8e18ed8cb58afb40a816ac0fdedfe3a7db5f (patch) | |
tree | 681a9cbb6c22669c6e8b7ab749228a3cd691a903 /crawl-ref/source/stash.cc | |
parent | 51d8f1fc9cc8ed4280b9c53b135ccb0521e84889 (diff) | |
download | crawl-ref-262b8e18ed8cb58afb40a816ac0fdedfe3a7db5f.tar.gz crawl-ref-262b8e18ed8cb58afb40a816ac0fdedfe3a7db5f.zip |
Massive overhaul to move towards coord_def().
This might have introduced some bugs: I now get intermittent crashes
on startup (this might have to do with the changes to special_room.)
Sorry about that - committing before I need to do any more big conflict
resolutions. Fixes coming later.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6732 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stash.cc')
-rw-r--r-- | crawl-ref/source/stash.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc index 9dc98a5779..17104cdddb 100644 --- a/crawl-ref/source/stash.cc +++ b/crawl-ref/source/stash.cc @@ -146,8 +146,8 @@ Stash::Stash(int xp, int yp) : enabled(true), items() // First, fix what square we're interested in if (xp == -1) { - xp = you.x_pos; - yp = you.y_pos; + xp = you.pos().x; + yp = you.pos().y; } x = (unsigned char) xp; y = (unsigned char) yp; @@ -263,18 +263,19 @@ bool Stash::is_boring_feature(dungeon_feature_type feat) void Stash::update() { - feat = grd[x][y]; + coord_def p(x,y); + feat = grd(p); trap = NUM_TRAPS; if (is_boring_feature(feat)) feat = DNGN_FLOOR; if (grid_is_trap(feat)) - trap = trap_type_at_xy(coord_def(x, y)); + trap = trap_type_at_xy(p); int objl = igrd[x][y]; // If this is your position, you know what's on this square - if (x == you.x_pos && y == you.y_pos) + if (p == you.pos()) { // Zap existing items items.clear(); @@ -1054,8 +1055,8 @@ const Stash *LevelStashes::find_stash(int x, int y) const { if (x == -1 || y == -1) { - x = you.x_pos; - y = you.y_pos; + x = you.pos().x; + y = you.pos().y; } const int abspos = (GXM * y) + x; stashes_t::const_iterator st = m_stashes.find(abspos); |