diff options
-rw-r--r-- | crawl-ref/source/AppHdr.h | 38 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/dungeon.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/itemname.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 17 |
5 files changed, 40 insertions, 30 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index e1cbba9582..840480b808 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -410,29 +410,25 @@ FIXME: replace system(3) with fork(2) and execve(2). */ - // Comment these lines out if you want to leave the save files uncompressed. - #define SAVE_PACKAGE_ZIP -// #define SAVE_PACKAGE_TAR - -#ifdef SAVE_PACKAGE_ZIP - #define PACKAGE_SUFFIX ".zip" - #define SAVE_PACKAGE_CMD "/usr/bin/zip -m -q -j -1 %s.zip %s.*" - #define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip -d %s" -#else -#ifdef SAVE_PACKAGE_TAR - #define PACKAGE_SUFFIX ".tgz" - - // The --absolute-names switch is only there to suppress noise on - // stdout. All the paths are removed later by --transform. - #define SAVE_PACKAGE_CMD "tar -zcf %s.tgz --remove-files --absolute-names --transform=s:.*/:: %s.*" - #define LOAD_UNPACKAGE_CMD "tar -zxf %s.tgz -C %s" -#endif -#endif + // The default behaviour is to compress with zip. + // To use GNU tar instead, define SAVE_PACKAGE_TAR. + // To avoid compression entirely, define SAVE_PACKAGE_NONE. + #ifndef SAVE_PACKAGE_NONE + #ifdef SAVE_PACKAGE_TAR + // The --absolute-names switch is only there to suppress noise on stdout. + // All the paths are removed later by --transform. + #define PACKAGE_SUFFIX ".tgz" + #define SAVE_PACKAGE_CMD "tar -zcf %s.tgz --remove-files --absolute-names --transform=s:.*/:: %s.*" + #define LOAD_UNPACKAGE_CMD "tar -zxf %s.tgz -C %s" + #else + #define PACKAGE_SUFFIX ".zip" + #define SAVE_PACKAGE_CMD "/usr/bin/zip -m -q -j -1 %s.zip %s.*" + #define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip -d %s" + #endif -#ifdef SAVE_PACKAGE_CMD - // This is used to unpack specific files from the archive. + // This is used to unpack a specific file from the archive. #define UNPACK_SPECIFIC_FILE_CMD LOAD_UNPACKAGE_CMD " %s" -#endif + #endif // This defines the chmod permissions for score and bones files. #define SHARED_FILES_CHMOD_PRIVATE 0664 diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index c6863e4cb4..25047e2099 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -906,7 +906,11 @@ static std::string _describe_weapon(const item_def &item, bool verbose) description += ", and it is better for the dexterous"; description += "."; } - + if (player_size(PSIZE_BODY) < SIZE_MEDIUM + && !check_weapon_wieldable_size(item, player_size(PSIZE_BODY))) + { + description += "$It is too large for you to wield."; + } } if (verbose) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 2450a1475f..14d7f60374 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2335,8 +2335,10 @@ static builder_rc_type _builder_by_type(int level_number, char level_type) ASSERT(vault); if (!vault) + { end(1, false, "Failed to find Pandemonium level %s!\n", pandemon_level_names[which_demon]); + } _ensure_vault_placed( _build_vaults(level_number, vault), true ); } diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index c5da1c9cdf..247f6b3b81 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2498,6 +2498,13 @@ bool is_useless_item(const item_def &item, bool temp) switch (item.base_type) { case OBJ_WEAPONS: + if (player_size(PSIZE_BODY) < SIZE_MEDIUM + && !check_weapon_wieldable_size(item, player_size(PSIZE_BODY))) + { + // Weapon is too large to be wielded. + return (true); + } + if (!item_type_known(item)) return (false); diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 0db1d9fdf0..3383a13c9a 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -823,17 +823,18 @@ int TilesFramework::getch_ck() switch (event.type) { + case SDL_ACTIVEEVENT: + // When game gains focus back then set mod state clean + // to get rid of stupid Windows/SDL bug with Alt-Tab. + if (event.active.gain != 0) + { + SDL_SetModState(KMOD_NONE); + set_need_redraw(); + } + break; case SDL_KEYDOWN: m_key_mod |= _get_modifiers(event.key.keysym); key = _translate_keysym(event.key.keysym); - if (m_key_mod == MOD_ALT - && key_to_command(key, KMC_DEFAULT) == CMD_NO_CMD) - { - // If the Alt key is pressed and the command is invalid, - // try clearing the Alt key in case it got stuck in - // the stupid Windows/SDL bug with Alt-Tab. - m_key_mod &= ~MOD_ALT; - } m_region_tile->place_cursor(CURSOR_MOUSE, Region::NO_CURSOR); // If you hit a key, disable tooltips until the mouse |