summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-15 12:10:59 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-15 12:10:59 +0000
commitfb0ab9913b253f6648b2848e7432f29f4b1f2d9f (patch)
tree9702c084398bb4972fcca9f20e57d86e14917727 /crawl-ref/source/items.cc
parent47146d5cc5e08c3afe7f14a7af610db364a99aef (diff)
downloadcrawl-ref-fb0ab9913b253f6648b2848e7432f29f4b1f2d9f.tar.gz
crawl-ref-fb0ab9913b253f6648b2848e7432f29f4b1f2d9f.zip
Cleanup: move_item_to_grid returns a bool to indicate that drop was successful.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2471 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 268f47cac2..7fe521fb3f 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1601,11 +1601,11 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
//
// Done this way in the hopes that it will be obvious from
// calling code that "obj" is possibly modified.
-void move_item_to_grid( int *const obj, int x, int y )
+bool move_item_to_grid( int *const obj, int x, int y )
{
// must be a valid reference to a valid object
if (*obj == NON_ITEM || !is_valid_item( mitm[*obj] ))
- return;
+ return (false);
// If it's a stackable type...
if (is_stackable_item( mitm[*obj] ))
@@ -1615,7 +1615,7 @@ void move_item_to_grid( int *const obj, int x, int y )
{
// check if item already linked here -- don't want to unlink it
if (*obj == i)
- return;
+ return (false);
if (items_stack( mitm[*obj], mitm[i] ))
{
@@ -1624,7 +1624,7 @@ void move_item_to_grid( int *const obj, int x, int y )
inc_mitm_item_quantity( i, mitm[*obj].quantity );
destroy_item( *obj );
*obj = i;
- return;
+ return (true);
}
}
}
@@ -1668,7 +1668,7 @@ void move_item_to_grid( int *const obj, int x, int y )
set_branch_flags(BFLAG_HAS_ORB);
}
- return;
+ return (true);
}
void move_item_stack_to_grid( int x, int y, int targ_x, int targ_y )