diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 13:27:09 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-15 13:27:09 +0000 |
commit | 968b72f7e415665bdb896fe3979f8049d69a930f (patch) | |
tree | 601f2fc6bfd5ee5107148eb6c8597699d8951cb2 /crawl-ref/source/output.cc | |
parent | cfdd70607a856b8a37d64f86479ba2f7310f8a80 (diff) | |
download | crawl-ref-968b72f7e415665bdb896fe3979f8049d69a930f.tar.gz crawl-ref-968b72f7e415665bdb896fe3979f8049d69a930f.zip |
Fix 2018325 (compiling with gcc 4.3) by applying the patch by nathanj439.
Re-enable friendly pickup toggle for all characters and change wording
to make it clearer it may have no effect. (Fixes 2018493.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6557 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/output.cc')
-rw-r--r-- | crawl-ref/source/output.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index b05dbbc515..76ed767ef2 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1190,14 +1190,17 @@ monster_pane_info::monster_pane_info(const monsters *m) if (m->has_ench(ENCH_BERSERK)) m_brands |= 4; } -// Sort monsters by: -// attitude -// difficulty -// type -// brand -bool // static -monster_pane_info::less_than(const monster_pane_info& m1, - const monster_pane_info& m2, bool zombified) +// Needed because gcc 4.3 sort does not like comparison functions that take +// more than 2 arguments. +bool monster_pane_info::less_than_wrapper(const monster_pane_info& m1, + const monster_pane_info& m2) +{ + return monster_pane_info::less_than(m1, m2, true); +} + +// Sort monsters by (in that order): attitude, difficulty, type, brand +bool monster_pane_info::less_than(const monster_pane_info& m1, + const monster_pane_info& m2, bool zombified) { if (m1.m_attitude < m2.m_attitude) return (true); @@ -1468,7 +1471,7 @@ void get_monster_pane_info(std::vector<monster_pane_info>& mons) mons.push_back(monster_pane_info(visible[i])); } } - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than_wrapper); } #define BOTTOM_JUSTIFY_MONSTER_LIST 0 @@ -1484,7 +1487,7 @@ int update_monster_pane() std::vector<monster_pane_info> mons; get_monster_pane_info(mons); - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + std::sort(mons.begin(), mons.end(), monster_pane_info::less_than_wrapper); // Count how many groups of monsters there are unsigned int lines_needed = mons.size(); @@ -1501,7 +1504,9 @@ int update_monster_pane() // "rat zombie") in order to take up less lines. for (unsigned int i = 0; i < mons.size(); i++) mons[i].m_fullname = false; - std::sort(mons.begin(), mons.end(), monster_pane_info::less_than); + + std::sort(mons.begin(), mons.end(), + monster_pane_info::less_than_wrapper); lines_needed = mons.size(); for (unsigned int i = 1; i < mons.size(); i++) |