summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-20 14:35:26 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-20 14:35:26 +0000
commit63d894283308e25a8d98eead954251ff7f6c606f (patch)
tree83485a6771140e6580c4f67369147db9f989a8c0 /crawl-ref/source/items.cc
parent31940f5b3abb5a8ad9fe4ba4a420f943bf84eb03 (diff)
downloadcrawl-ref-63d894283308e25a8d98eead954251ff7f6c606f.tar.gz
crawl-ref-63d894283308e25a8d98eead954251ff7f6c606f.zip
Attempting to move or copy and item to a out-of-bounds position on the grid
will now assert. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8627 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 53f4381b7f..a8e235b098 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1732,6 +1732,8 @@ void mark_items_non_pickup_at(const coord_def &pos)
// calling code that "obj" is possibly modified.
bool move_item_to_grid( int *const obj, const coord_def& p )
{
+ ASSERT(in_bounds(p));
+
int& ob(*obj);
// Must be a valid reference to a valid object.
if (ob == NON_ITEM || !is_valid_item( mitm[ob] ))
@@ -1832,6 +1834,8 @@ void move_item_stack_to_grid( const coord_def& from, const coord_def& to )
bool copy_item_to_grid( const item_def &item, const coord_def& p,
int quant_drop, bool mark_dropped )
{
+ ASSERT(in_bounds(p));
+
if (quant_drop == 0)
return (false);