aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2013-09-21 22:36:23 +0200
committerjackpoz <giacomopoz@gmail.com>2013-09-21 22:36:23 +0200
commit9579d0a3e717b918192a5dfab520ec1033dfe64c (patch)
tree271fd60309e19c93f87737944c344947c499bbcf
parentaf63c8783e48b6a618f7406857d6bc56d142d390 (diff)
Scripts/ScarletEnclave: Fix uninitialized values in Highlord Darion Mograine
Reset() has if checks on values that are initialized after them so it's required to initialize these fields in the constructor. Valgrind log: Conditional jump or move depends on uninitialised value(s) by 0x11CF472: HashMapHolder<Creature>::Find(unsigned long) (ObjectAccessor.h:67) by 0x11CE36F: Creature* ObjectAccessor::GetObjectInWorld<Creature>(unsigned long, Creature*) (ObjectAccessor.h:114) by 0x1257C13: Creature* ObjectAccessor::GetObjectInMap<Creature>(unsigned long, Map*, Creature*) (ObjectAccessor.h:135) by 0x12E64F1: Map::GetCreature(unsigned long) (Map.cpp:2767) by 0x10AF4DE: Unit::GetCreature(WorldObject&, unsigned long) (Unit.cpp:13021) by 0x16F8F81: npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::Reset() (chapter5.cpp:386) by 0x16F8D36: npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::npc_highlord_darion_mograineAI(Creature*) (chapter5.cpp:314) by 0x16F8CD6: npc_highlord_darion_mograine::GetAI(Creature*) const (chapter5.cpp:307) by 0x132AF6C: ScriptMgr::GetCreatureAI(Creature*) (ScriptMgr.cpp:796) by 0x1441D45: FactorySelector::selectAI(Creature*) (CreatureAISelector.cpp:41)
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
index 382a0002065..ab1367ed684 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
@@ -311,6 +311,23 @@ public:
{
npc_highlord_darion_mograineAI(Creature* creature) : npc_escortAI(creature)
{
+ uiTirionGUID = 0;
+ uiKorfaxGUID = 0;
+ uiMaxwellGUID = 0;
+ uiEligorGUID = 0;
+ uiRayneGUID = 0;
+ uiKoltiraGUID = 0;
+ uiOrbazGUID = 0;
+ uiThassarianGUID = 0;
+ uiLichKingGUID = 0;
+
+ memset(uiDefenderGUID, 0, sizeof(uiDefenderGUID));
+ memset(uiEarthshatterGUID, 0, sizeof(uiEarthshatterGUID));
+ memset(uiAbominationGUID, 0, sizeof(uiAbominationGUID));
+ memset(uiBehemothGUID, 0, sizeof(uiBehemothGUID));
+ memset(uiGhoulGUID, 0, sizeof(uiGhoulGUID));
+ memset(uiWarriorGUID, 0, sizeof(uiWarriorGUID));
+
Reset();
}