From 63d894283308e25a8d98eead954251ff7f6c606f Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 20 Jan 2009 14:35:26 +0000 Subject: 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 --- crawl-ref/source/items.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crawl-ref/source/items.cc') 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); -- cgit v1.2.3-54-g00ecf