diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-27 21:53:45 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-27 21:53:45 +0000 |
commit | 18c6841dbd2281ea14161c625e893afa469a090e (patch) | |
tree | e219e9bd2ad15944ddfcf6ac72ddb9daaecaf7b9 /crawl-ref/source | |
parent | ffd7b999da940618860de7ce6e786175bc9af184 (diff) | |
download | crawl-ref-18c6841dbd2281ea14161c625e893afa469a090e.tar.gz crawl-ref-18c6841dbd2281ea14161c625e893afa469a090e.zip |
Fix crash bug with trolls/nagas pointed out by dolorous.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9263 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/mutation.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index 9dc256b379..62cd28757c 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1281,8 +1281,6 @@ void fixup_mutations() bool mutation_is_fully_active(mutation_type mut) { - const mutation_def& mdef = get_mutation_def(mut); - // For all except the semi-undead, mutations always apply. if (you.is_undead != US_SEMI_UNDEAD) return (true); @@ -1291,12 +1289,12 @@ bool mutation_is_fully_active(mutation_type mut) if (you.demon_pow[mut]) return (true); - // ... as are physical mutations - if (mdef.physical) + // ... as are all mutations for semi-undead who are fully alive + if (you.hunger_state == HS_ENGORGED) return (true); - // ... as are all mutations for semi-undead who are fully alive. - if (you.hunger_state == HS_ENGORGED) + // ... as are physical mutations. + if (get_mutation_def(mut).physical) return (true); return (false); @@ -2698,12 +2696,16 @@ std::string mutation_name(mutation_type mut, int level, bool colour) (you.species == SP_TROLL || you.species == SP_GHOUL)) { innate = true; + if (you.species == SP_TROLL) + result = troll_claw_descrip[level]; } if ((mut == MUT_FAST || mut == MUT_BREATHE_POISON) && you.species == SP_NAGA) { innate = true; + if (mut == MUT_FAST) + result = naga_speed_descrip[level]; } const mutation_def& mdef = get_mutation_def(mut); @@ -2716,7 +2718,7 @@ std::string mutation_name(mutation_type mut, int level, bool colour) ostr << mdef.have[0] << level << ")."; result = ostr.str(); } - else + else if (result.empty() && level > 0) result = mdef.have[level - 1]; if (fully_inactive) |