diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 17:28:40 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 17:28:40 -0800 |
commit | 8c9924e60faee7101352a553f892bf7eb2c03ab6 (patch) | |
tree | 91c8ea3035d7b9bddd7b0e6de29b9cf0bcf8a221 /crawl-ref/source | |
parent | 2b54fbf65f2ca782c04f56d0fea7d5a43bb56d5a (diff) | |
download | crawl-ref-8c9924e60faee7101352a553f892bf7eb2c03ab6.tar.gz crawl-ref-8c9924e60faee7101352a553f892bf7eb2c03ab6.zip |
Fixed monsters class unitialized memory propblem
The monsters constructor wasn't initializing the base_monster member,
which led to a Valgrind unitialized memory warning in
monsters::upgrade_type()
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/monster.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index fa93d0a800..304a019dd0 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -47,12 +47,13 @@ static mon_spellbook mspell_list[] = { monsters::monsters() : type(MONS_NO_MONSTER), hit_points(0), max_hit_points(0), hit_dice(0), - ac(0), ev(0), speed(0), speed_increment(0), - target(), patrol_point(), travel_target(MTRAV_NONE), - inv(NON_ITEM), spells(), attitude(ATT_HOSTILE), behaviour(BEH_WANDER), - foe(MHITYOU), enchantments(), flags(0L), experience(0), number(0), - colour(BLACK), foe_memory(0), shield_blocks(0), god(GOD_NO_GOD), ghost(), - seen_context(""), props() + ac(0), ev(0), speed(0), speed_increment(0), target(), patrol_point(), + travel_target(MTRAV_NONE), inv(NON_ITEM), spells(), + attitude(ATT_HOSTILE), behaviour(BEH_WANDER), foe(MHITYOU), + enchantments(), flags(0L), experience(0), base_monster(MONS_NO_MONSTER), + number(0), colour(BLACK), foe_memory(0), shield_blocks(0), + god(GOD_NO_GOD), ghost(), seen_context(""), props() + { travel_path.clear(); if (crawl_state.arena) |