summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 90ccd5ac9e..cbb771dfaa 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -44,6 +44,7 @@
#include "mstuff2.h"
#include "ouch.h"
#include "player.h"
+#include "quiver.h"
#include "randart.h"
#include "religion.h"
#include "skills.h"
@@ -2424,12 +2425,19 @@ bool cast_portal_projectile(int pow, bolt& beam)
return 0;
}
- const int idx = get_current_fire_item();
- if ( idx == ENDOFPACK )
+ int idx;
+ const item_def* item;
+ you.m_quiver->get_desired_item(&item, &idx);
+ if ( item == NULL )
{
mpr("No suitable missiles.");
return false;
}
+ else if ( idx == -1 )
+ {
+ mpr("No missiles left.");
+ return false;
+ }
throw_it( beam, idx, true, random2(pow/4) );
return true;