git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6683 c06c8d41-db1a-0410-9941-cceddc491573
KLE4PF466VJJ56WVBMTFDS3B4KHVV5VNSKJT6DQN6BRH5NLSPNOQC
}
}
// Remove any items that are on squares that items should not be on.
// link_items() must be called after this function.
static void _fixup_misplaced_items()
{
for (int i = 0; i < MAX_ITEMS; i++)
{
if (!is_valid_item(mitm[i]) || (mitm[i].x == 0 && mitm[i].y == 0))
continue;
coord_def gc(mitm[i].x, mitm[i].y);
if (in_bounds(gc))
{
dungeon_feature_type feat = grd(gc);
if (feat >= DNGN_MINITEM)
continue;
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
"Item buggily placed in feature at (%d, %d).", gc.x, gc.y);
#endif
}
else
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
"Item buggily placed out of bounds at (%d, %d).", gc.x, gc.y);
#endif
}
// Can't just unlink item because it might not have been linked yet.
mitm[i].base_type = OBJ_UNASSIGNED;
mitm[i].quantity = 0;
mitm[i].x = 0;
mitm[i].y = 0;