diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-22 21:00:05 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-22 21:02:48 -0800 |
commit | c94f94d6959395a96da97a4c163e44456277d1a1 (patch) | |
tree | 89f857c646b48e8bba22f4362629bc7d3c375f2b /crawl-ref/source/tilereg.cc | |
parent | ce0b009e851f37ee522e7e0ef420a0e9fb0b246e (diff) | |
download | crawl-ref-c94f94d6959395a96da97a4c163e44456277d1a1.tar.gz crawl-ref-c94f94d6959395a96da97a4c163e44456277d1a1.zip |
tiles: Make mod-L-click actions do-again-able
If you fire/cast/zap at a monster with mod-L-click, then you can do the
command over again with the "`" key. Doesn't work yet with spells cast
via the spell pane (toggled on with "_"), or with items fired via
clicking on the inventory pane.
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r-- | crawl-ref/source/tilereg.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index a226a8240b..a99167e2ec 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -1316,7 +1316,13 @@ static item_def* _get_evokable_item(const actor* target) static bool _evoke_item_on_target(actor* target) { - item_def* item = _get_evokable_item(target); + item_def* item; + { + // Prevent the inventory letter from being recorded twice. + pause_all_key_recorders pause; + + item = _get_evokable_item(target); + } if (item == NULL) return (false); @@ -1377,7 +1383,13 @@ static bool _cast_spell_on_target(actor* target) ASSERT(_spell_target == NULL); _spell_target = target; - const int letter = list_spells(true, false, -1, _spell_selector); + int letter; + { + // Prevent the spell letter from being recorded twice. + pause_all_key_recorders pause; + + letter = list_spells(true, false, -1, _spell_selector); + } _spell_target = NULL; |