diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-30 08:47:22 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-30 08:47:22 +0000 |
commit | 460535315751ea2239a98f1817ee0c1c11720e81 (patch) | |
tree | b01ee7da64211bc76cdcf92cb9a6b15d0c547225 /crawl-ref/source | |
parent | f1f838b18f17f470004d798383c3acb985a4b10d (diff) | |
download | crawl-ref-460535315751ea2239a98f1817ee0c1c11720e81.tar.gz crawl-ref-460535315751ea2239a98f1817ee0c1c11720e81.zip |
Fixed bad handling of w: tags in .des files (yellow:5 => fail) (David).
Fixed summoned monsters dropping their gear when killed (needs some adjustment).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3147 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/libutil.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 25e705a0ec..8b5bb7bbac 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -235,7 +235,10 @@ bool strip_tag(std::string &s, const std::string &tag, bool skip_padding) std::string strip_tag_prefix(std::string &s, const std::string &tagprefix) { - const std::string::size_type pos = s.find(tagprefix); + std::string::size_type pos = s.find(tagprefix); + while (pos && pos != std::string::npos && !isspace(s[pos - 1])) + pos = s.find(tagprefix, pos + 1); + if (pos == std::string::npos) return (""); diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 3f6e1dcc1e..867253ed37 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -494,6 +494,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) !silent && mons_near(monster) && player_monster_visible(monster); bool in_transit = false; const bool hard_reset = testbits(monster->flags, MF_HARD_RESET); + bool drop_items = !monster->has_ench(ENCH_ABJ) && !hard_reset; #ifdef DGL_MILESTONES check_kill_milestone(monster, killer, i); @@ -604,6 +605,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) place_cloud( random_smoke_type(), monster->x, monster->y, 1 + random2(3), monster->kill_alignment() ); + else + drop_items = true; } else { @@ -946,7 +949,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) monster_index(monster), killer)); const coord_def mwhere = monster->pos(); - if (!hard_reset) + if (drop_items) monster_drop_ething(monster, YOU_KILL(killer) || pet_kill); monster_cleanup(monster); |