From be0551c2205ac189be5558447625642553c80dd3 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Thu, 12 Nov 2009 20:15:52 -0800 Subject: porkulator: completely restore reverted monsters --- crawl-ref/source/beam.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 864d38d439..b5f7e83590 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -5371,13 +5371,20 @@ mon_resist_type bolt::apply_enchantment_to_monster(monsters* mon) if (mons_is_ghost_demon(mon->type)) return (MON_UNAFFECTED); - monster_type orig_type = mon->type; + monsters orig_mon(*mon); if (monster_polymorph(mon, (mon->holiness() == MH_DEMONIC ? MONS_HELL_HOG : MONS_HOG))) { obvious_effect = true; + + // Don't restore items to monster if it reverts. + orig_mon.inv = mon->inv; + + // For monster reverting to original form. + mon->props[ORIG_MONSTER_KEY] = orig_mon; } - mon->number = ((int) orig_type + 1); + + return (MON_AFFECTED); } -- cgit v1.2.3-54-g00ecf