From 71b6b1d375ea617a5ca3057063ea76e97dbfbd8f Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 25 Jul 2009 21:01:38 +0000 Subject: Apply kotk's minor fixes patch in [2827129], with minor tweaks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10409 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/describe.cc | 7 ++++++- crawl-ref/source/files.cc | 8 ++++---- crawl-ref/source/menu.h | 5 +++-- crawl-ref/source/spl-book.cc | 4 ++-- crawl-ref/source/spl-util.cc | 2 +- crawl-ref/source/tilereg.h | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 4049fd7ef3..c6863e4cb4 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1310,7 +1310,12 @@ static std::string _describe_armour( const item_def &item, bool verbose ) if (!is_known_artefact(item)) { const int max_ench = armour_max_enchant(item); - if (item.plus < max_ench || !item_ident( item, ISFLAG_KNOW_PLUSES )) + if (armour_is_hide(item)) + { + description += "$Enchanting it will turn it into a suit of " + "magical armour."; + } + else if (item.plus < max_ench || !item_ident(item, ISFLAG_KNOW_PLUSES)) { description += "$It can be maximally enchanted to +"; _append_value(description, max_ench, false); diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 5ab9bb330f..67bf806c93 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -672,14 +672,14 @@ std::vector find_saved_characters() for (unsigned int i = 0; i < allfiles.size(); ++i) { std::string filename = allfiles[i]; + + std::string::size_type point_pos = filename.find_last_of('.'); + std::string basename = filename.substr(0, point_pos); + #ifdef LOAD_UNPACKAGE_CMD if (!is_packed_save(filename)) continue; - std::string basename = - filename.substr(0, - filename.length() - strlen(PACKAGE_SUFFIX)); - const std::string zipname = get_savedir_path(basename); // This is the filename we actually read ourselves. diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h index 5ad7ed620a..b2cc572c30 100644 --- a/crawl-ref/source/menu.h +++ b/crawl-ref/source/menu.h @@ -62,8 +62,9 @@ int menu_colour(const std::string &itemtext, const std::string &prefix = "", const std::string &tag = ""); -struct MenuEntry +class MenuEntry { +public: std::string tag; std::string text; int quantity, selected_qty; @@ -148,7 +149,7 @@ struct MenuEntry #endif }; -struct ToggleableMenuEntry : public MenuEntry +class ToggleableMenuEntry : public MenuEntry { public: std::string alt_text; diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 6678c51f08..88f2008a38 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1942,10 +1942,10 @@ static bool _compare_spells(spell_type a, spell_type b) b_type = spelltype_name(mask); } ASSERT(a_type != NULL && b_type != NULL); - return (strcmp(a_type, b_type)); + return (strcmp(a_type, b_type) < 0); } - return (strcmp(spell_title(a), spell_title(b))); + return (strcmp(spell_title(a), spell_title(b)) < 0); } bool is_memorised(spell_type spell) diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 871f6a7ac9..0e9d3db292 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -781,7 +781,7 @@ const char* spelltype_short_name( int which_spelltype ) case SPTYP_ICE: return ("Ice"); case SPTYP_TRANSMUTATION: - return ("Tmgr"); + return ("Trmt"); case SPTYP_NECROMANCY: return ("Necr"); case SPTYP_HOLY: diff --git a/crawl-ref/source/tilereg.h b/crawl-ref/source/tilereg.h index 4efce0130a..f6f687b84c 100644 --- a/crawl-ref/source/tilereg.h +++ b/crawl-ref/source/tilereg.h @@ -33,7 +33,7 @@ public: }; // Windows and internal regions (text, dungeon, map, etc.) -class MouseEvent; +struct MouseEvent; class Region { -- cgit v1.2.3-54-g00ecf