summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-07 15:47:41 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2010-01-07 15:49:44 +0100
commit3746a0d9be464e1d03711ce19845e88320ab8b10 (patch)
tree734440a53630b6ba82b79147490ed06765d8159c /crawl-ref/source
parentdfe4d971e429a8b4af18b12589f4ba949535ac02 (diff)
downloadcrawl-ref-3746a0d9be464e1d03711ce19845e88320ab8b10.tar.gz
crawl-ref-3746a0d9be464e1d03711ce19845e88320ab8b10.zip
Fix 0000188: monster list bug with player ghost
A stupid typo (mine, probably) caused monster names to actually be compared with themselves, so the check would always return false.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/mon-info.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc
index cf4b7d0b79..63428a5828 100644
--- a/crawl-ref/source/mon-info.cc
+++ b/crawl-ref/source/mon-info.cc
@@ -65,7 +65,7 @@ monster_info::monster_info(const monsters *m)
// Needed because gcc 4.3 sort does not like comparison functions that take
// more than 2 arguments.
bool monster_info::less_than_wrapper(const monster_info& m1,
- const monster_info& m2)
+ const monster_info& m2)
{
return monster_info::less_than(m1, m2, true);
}
@@ -152,7 +152,7 @@ bool monster_info::less_than(const monster_info& m1,
}
if (m1.m_fullname && m2.m_fullname || m1type == MONS_PLAYER_GHOST)
- return (m1.m_mon->name(DESC_PLAIN) < m1.m_mon->name(DESC_PLAIN));
+ return (m1.m_mon->name(DESC_PLAIN) < m2.m_mon->name(DESC_PLAIN));
#if 0 // for now, sort brands together.
// By descending brands, so no brands sorts to the end
@@ -245,12 +245,12 @@ void monster_info::to_string(int count, std::string& desc,
// Don't differentiate between dancing weapons, mimics, (very)
// ugly things or draconians of different types.
else if (m_fullname
- && type != MONS_DANCING_WEAPON
- && mons_genus(type) != MONS_DRACONIAN
- && type != MONS_UGLY_THING
- && type != MONS_VERY_UGLY_THING
- && !mons_is_mimic(type)
- && m_mon->mname.empty())
+ && type != MONS_DANCING_WEAPON
+ && mons_genus(type) != MONS_DRACONIAN
+ && type != MONS_UGLY_THING
+ && type != MONS_VERY_UGLY_THING
+ && !mons_is_mimic(type)
+ && m_mon->mname.empty())
{
out << count << " "
<< pluralise(m_mon->name(DESC_PLAIN));
@@ -351,4 +351,3 @@ void get_monster_info(std::vector<monster_info>& mons)
}
std::sort(mons.begin(), mons.end(), monster_info::less_than_wrapper);
}
-