From 8c9924e60faee7101352a553f892bf7eb2c03ab6 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sun, 15 Nov 2009 17:28:40 -0800 Subject: 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() --- crawl-ref/source/monster.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source') 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) -- cgit v1.2.3-54-g00ecf