summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-book.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-13 14:25:59 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-13 14:25:59 +0000
commit8b4a043aa12cf1492ff94b0ef071afce5997dff2 (patch)
tree5b1782763a08d00f95ad51882703bf4354be160c /crawl-ref/source/spl-book.cc
parent1166a9ad592519f1281df08d12f1c52b4642c8d5 (diff)
downloadcrawl-ref-8b4a043aa12cf1492ff94b0ef071afce5997dff2.tar.gz
crawl-ref-8b4a043aa12cf1492ff94b0ef071afce5997dff2.zip
Add the last missing spell tiles.
Update change log. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10668 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-book.cc')
-rw-r--r--crawl-ref/source/spl-book.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index a1c83caa89..6023dece43 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -1485,6 +1485,16 @@ bool has_spells_to_memorise()
return _get_mem_list(mem_spells, book_hash, num_unreadable, num_race, true);
}
+static bool _sort_mem_spells(spell_type a, spell_type b)
+{
+ if (spell_fail(a) != spell_fail(b))
+ return (spell_fail(a) < spell_fail(b));
+ if (spell_difficulty(a) != spell_difficulty(b))
+ return (spell_difficulty(a) < spell_difficulty(b));
+
+ return (stricmp(spell_title(a), spell_title(b)) < 0);
+}
+
std::vector<spell_type> get_mem_spell_list()
{
std::vector<spell_type> spells;
@@ -1497,22 +1507,14 @@ std::vector<spell_type> get_mem_spell_list()
if (!_get_mem_list(mem_spells, book_hash, num_unreadable, num_race))
return (spells);
+ std::sort(mem_spells.begin(), mem_spells.end(), _sort_mem_spells);
+
for (unsigned int i = 0; i < mem_spells.size(); i++)
spells.push_back(mem_spells[i]);
return (spells);
}
-static bool _sort_mem_spells(spell_type a, spell_type b)
-{
- if (spell_fail(a) != spell_fail(b))
- return (spell_fail(a) < spell_fail(b));
- if (spell_difficulty(a) != spell_difficulty(b))
- return (spell_difficulty(a) < spell_difficulty(b));
-
- return (stricmp(spell_title(a), spell_title(b)) < 0);
-}
-
static spell_type _choose_mem_spell(spell_list &spells,
spells_to_books &book_hash,
unsigned long num_unreadable,