summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/debug.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 10ff399047..ae8f27fe45 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -824,8 +824,12 @@ static bool _sort_monster_list(int a, int b)
return ( m1->name(DESC_PLAIN, true) < m2->name(DESC_PLAIN, true) );
}
- if (mons_char(m1->type) < mons_char(m2->type))
- return (true);
+ const unsigned glyph1 = mons_char(m1->type);
+ const unsigned glyph2 = mons_char(m2->type);
+ if (glyph1 != glyph2)
+ {
+ return (glyph1 < glyph2);
+ }
return (m1->type < m2->type);
}