summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abyss.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-08 11:56:10 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-08 11:56:10 +0000
commitd8a3aef168a6f025525282d57a4649c01439404d (patch)
tree19980a35173d7f2148d440b4b9bd5a51f5719b08 /crawl-ref/source/abyss.cc
parent4a90639598b8814c8c9036a8b8d2deccbc16d50f (diff)
downloadcrawl-ref-d8a3aef168a6f025525282d57a4649c01439404d.tar.gz
crawl-ref-d8a3aef168a6f025525282d57a4649c01439404d.zip
Fix 2008976: Unlinked items after area_shift()
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6454 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/abyss.cc')
-rw-r--r--crawl-ref/source/abyss.cc25
1 files changed, 20 insertions, 5 deletions
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index e3e850af08..2ded18e8a7 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -74,13 +74,15 @@ static bool _place_feature_near( const coord_def &centre,
return (false);
}
+//#define DEBUG_ABYSS
+
// Public for abyss generation.
void generate_abyss()
{
int i, j; // loop variables
int temp_rand; // probability determination {dlb}
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mprf(MSGCH_DIAGNOSTICS,
"generate_abyss(); turn_on_level: %d", env.turns_on_level);
#endif
@@ -157,7 +159,7 @@ static void _generate_area(int gx1, int gy1, int gx2, int gy2,
bool placed_abyssal_rune =
find_floor_item(OBJ_MISCELLANY, MISC_RUNE_OF_ZOT);
-#if DEBUG_ABYSS
+#ifdef DEBUG_ABYSS
mprf(MSGCH_DIAGNOSTICS,
"_generate_area(). turns_on_level: %d, rune_on_floor: %s",
env.turns_on_level, placed_abyssal_rune? "yes" : "no");
@@ -403,7 +405,8 @@ static void _abyss_lose_monster(monsters &mons)
void area_shift(void)
{
#ifdef DEBUG_ABYSS
- mpr("area_shift().", MSGCH_DIAGNOSTICS);
+ mprf(MSGCH_DIAGNOSTICS, "area_shift() - player at pos (%d, %d)",
+ you.x_pos, you.y_pos);
#endif
// Preserve floor props around the player, primarily so that
@@ -469,6 +472,10 @@ void area_shift(void)
grd[i][j] = DNGN_UNSEEN;
// Nuke items.
+#ifdef DEBUG_ABYSS
+ if (igrd[i][j] != NON_ITEM)
+ mprf(MSGCH_DIAGNOSTICS, "Nuke item stack at (%d, %d)", i, j);
+#endif
lose_item_stack( i, j );
if (mgrd[i][j] != NON_MONSTER)
@@ -476,12 +483,12 @@ void area_shift(void)
}
// Shift all monsters & items to new area.
- for (int i = you.x_pos - 10; i < you.x_pos + 11; i++)
+ for (int i = you.x_pos - 10; i <= you.x_pos + 10; i++)
{
if (i < 0 || i >= GXM)
continue;
- for (int j = you.y_pos - 10; j < you.y_pos + 11; j++)
+ for (int j = you.y_pos - 10; j <= you.y_pos + 10; j++)
{
if (j < 0 || j >= GYM)
continue;
@@ -493,6 +500,14 @@ void area_shift(void)
grd[ipos][jpos] = grd[i][j];
// Move item.
+#ifdef DEBUG_ABYSS
+ if (igrd[i][j] != NON_ITEM)
+ {
+ mprf(MSGCH_DIAGNOSTICS,
+ "Move item stack from (%d, %d) to (%d, %d)",
+ i, j, ipos, jpos);
+ }
+#endif
move_item_stack_to_grid( i, j, ipos, jpos );
// Move monster.