diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-02 16:52:40 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-02 16:52:40 +0000 |
commit | 0a4efdf86b33220269f7439aeb5952a88d50efa7 (patch) | |
tree | fb0826c6072cd6f598ed9e905dea8faa4fd30601 /crawl-ref/source/itemprop.cc | |
parent | b50eafe8de72cbcc4431813934695c22642cdd46 (diff) | |
download | crawl-ref-0a4efdf86b33220269f7439aeb5952a88d50efa7.tar.gz crawl-ref-0a4efdf86b33220269f7439aeb5952a88d50efa7.zip |
Fix a stupid bug I'd introduced when fixing another one.
Fix 1939901: Weapon listing not updated right away after being cursed.
Put the code to colour arbitrary substrings of a message according to
the menu_colour settings into a function of its own, and use it for
pick up and eating prompts (currently from floor only) as well as for
the "Things that are here" listing. Could be overly spammy, thus needs
testing. If all works well, we can remove the "msg =" settings in
food_colouring.txt that currently don't do anything anyway, or reuse
them for non-prompt messages like "You see here a green rat corpse."
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5436 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 01030b45f8..df2d9250bf 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -499,6 +499,11 @@ void do_curse_item( item_def &item, bool quiet ) { amusement *= 2; } + else if (you.equip[EQ_WEAPON] == item.link) + { + // Redraw the weapon. + you.wield_change = true; + } } xom_is_stimulated(amusement); } @@ -514,6 +519,11 @@ void do_curse_item( item_def &item, bool quiet ) void do_uncurse_item( item_def &item ) { + if (item.x == -1 && item.y == -1 && you.equip[EQ_WEAPON] == item.link) + { + // Redraw the weapon. + you.wield_change = true; + } item.flags &= (~ISFLAG_CURSED); } @@ -1334,10 +1344,6 @@ bool is_enchantable_weapon(const item_def &wpn, bool uncurse) if (wpn.base_type != OBJ_WEAPONS && wpn.base_type != OBJ_MISSILES) return (false); - // only equipped items should be affected -// if (!item_is_equipped(wpn)) -// return (false); - // Artefacts cannot be enchanted (missiles can't be artefacts). if (wpn.base_type == OBJ_WEAPONS && (is_fixed_artefact(wpn) |