From 61ad137b444b36881d1e8409e194c77d33cb34a9 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 8 Apr 2007 14:27:31 +0000 Subject: Merged trunk revisions 1266 and 1267 into 0.2: - A former ghost being assigned from another monster would retain the ghost struct, fixed (harmless). - Another case of monsters picking up enchantments from unrelated monsters squelched. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.2@1268 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-util.cc | 4 +++- crawl-ref/source/tags.cc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index f25858a518..b1dd2696b0 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2450,7 +2450,9 @@ void monsters::init_with(const monsters &mon) god = mon.god; if (mon.ghost.get()) - ghost.reset( new ghost_demon( *mon.ghost ) ); + ghost.reset(new ghost_demon( *mon.ghost )); + else + ghost.reset(NULL); } coord_def monsters::pos() const diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 68fa56440e..6dae67aca2 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1600,6 +1600,7 @@ static void unmarshall_monster(tagHeader &th, monsters &m) m.target_y = unmarshallByte(th); m.flags = unmarshallLong(th); + m.enchantments.clear(); const int nenchs = unmarshallShort(th); for (int i = 0; i < nenchs; ++i) m.enchantments.insert( unmarshall_mon_enchant(th) ); -- cgit v1.2.3-54-g00ecf