diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-08-28 16:32:54 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-08-28 16:32:54 +0000 |
commit | 36d43983b6cc312fefe3a2e67db91f5235084155 (patch) | |
tree | 025209ea077c51b64dbbfc842db62ce5ed168e29 /crawl-ref | |
parent | baf36321bb2a9957984012e6101e9bfc41457d4f (diff) | |
download | crawl-ref-36d43983b6cc312fefe3a2e67db91f5235084155.tar.gz crawl-ref-36d43983b6cc312fefe3a2e67db91f5235084155.zip |
Fix 2073715: stave type not IDing from combat.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6866 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/fight.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 19 |
2 files changed, 7 insertions, 13 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index ba2d50f12b..f0ce3aaaa4 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2634,6 +2634,7 @@ void melee_attack::player_apply_staff_damage() if (!item_type_known(*weapon)) { set_ident_flags( *weapon, ISFLAG_KNOW_TYPE ); + set_ident_type( *weapon, ID_KNOWN_TYPE ); mprf("You are wielding %s.", weapon->name(DESC_NOCAP_A).c_str()); more(); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index aec70f124f..d3ff4048d3 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -439,9 +439,6 @@ int spell_fail(spell_type spell) int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check) { - unsigned int bit; - int ndx; - // When checking failure rates, wizardry is handled after the various // stepping calulations. int power = (you.skills[SK_SPELLCASTING] / 2) @@ -456,15 +453,11 @@ int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check) int skillcount = count_bits( disciplines ); if (skillcount) { - for (ndx = 0; ndx <= SPTYP_LAST_EXPONENT; ndx++) + for (int ndx = 0; ndx <= SPTYP_LAST_EXPONENT; ndx++) { - bit = 1 << ndx; - if ((bit != SPTYP_HOLY) && (disciplines & bit)) - { - int skill = spell_type2skill( bit ); - - power += (you.skills[skill] * 2) / skillcount; - } + unsigned int bit = (1 << ndx); + if (disciplines & bit) + power += (you.skills[spell_type2skill(bit)] * 2) / skillcount; } } @@ -478,7 +471,7 @@ int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check) if (enhanced > 0) { - for (ndx = 0; ndx < enhanced; ndx++) + for (int i = 0; i < enhanced; i++) { power *= 15; power /= 10; @@ -486,7 +479,7 @@ int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check) } else if (enhanced < 0) { - for (ndx = enhanced; ndx < 0; ndx++) + for (int i = enhanced; i < 0; i++) power /= 2; } |