summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 6364789e5f..35b27a7a07 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1019,9 +1019,11 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
{
potion = prompt_invent_item("Throw which potion?",
MT_INVLIST, OBJ_POTIONS);
- if (potion == -1)
+
+ if (prompt_failed(potion))
return (SPRET_ABORT);
- else if (you.inv[potion].base_type != OBJ_POTIONS)
+
+ if (you.inv[potion].base_type != OBJ_POTIONS)
{
mpr("This spell works only on potions!");
return (SPRET_ABORT);