summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-06 18:13:14 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-06 18:13:14 +0000
commitc5887300c0f938671c78fc4a59f74ea98ac5bd04 (patch)
tree0aa4af54b9bf23b76fbba657c8d04633ac71118e /crawl-ref/source/item_use.cc
parentacd89a148d572cedafcf498496df2d3ce42a6980 (diff)
downloadcrawl-ref-c5887300c0f938671c78fc4a59f74ea98ac5bd04.tar.gz
crawl-ref-c5887300c0f938671c78fc4a59f74ea98ac5bd04.zip
Fix 2726622: untransforming not prompting for safe-inscribed equipment
Also, when transforming voluntarily (i.e. not via Xom or by drawing a card) you get prompted for the loss of safe-inscribed equipment. If you opt out, it costs neither turn nor mana. There's an edge case when you change from one transformation to another one: if that fails for whatever reason you lose the turn (due to untransforming) and the spell fizzles (including mana loss). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9588 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cc1b5f89bd..cbef83db3c 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -324,7 +324,7 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages,
return (false);
}
- // Wield the weapon.
+ // Make sure that wielding the weapon won't kill the player.
if (!safe_to_remove_or_wear(new_wpn, false))
return (false);
@@ -334,7 +334,7 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages,
you.equip[EQ_WEAPON] = item_slot;
- // any oddness on wielding taken care of here
+ // Any oddness on wielding taken care of here.
wield_effects(item_slot, show_weff_messages);
mpr(new_wpn.name(DESC_INVENTORY_EQUIP).c_str());
@@ -3460,10 +3460,11 @@ static bool _swap_rings(int ring_slot)
if (!remove_ring(unwanted, false))
return (false);
- // Put on the new ring.
+ // Check that the new ring won't kill us.
if (!safe_to_remove_or_wear(you.inv[ring_slot], false))
return (false);
+ // Put on the new ring.
start_delay(DELAY_JEWELLERY_ON, 1, ring_slot);
return (true);