Jump to content

[Mangos one][Patch] Fix client-crash when summoning warlock-pet


Guest FH3095

Recommended Posts

Fix: The client crashes when summoning a warlock-pet for the first time.

That happens because Spell::EffectSummonPet doesn't set the class-byte for the pet.

Repository: Rev 1153

Authors: Me

From 50203cb1a0797d362cd7a9658fc12359e81ccbe0 Mon Sep 17 00:00:00 2001
From: FH <[email protected]>
Date: Thu, 28 Apr 2011 16:12:02 +0200
Subject: [PATCH] Fix client-crash while summoning warlock-pet first-time

---
src/game/SpellEffects.cpp |    1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 79590ab..45bcb6e 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4045,6 +4045,7 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx)
    NewSummon->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
    NewSummon->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
    NewSummon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
+    NewSummon->SetByteValue(UNIT_FIELD_BYTES_0, 1, CLASS_MAGE);

    NewSummon->UpdateWalkMode(m_caster);

-- 
1.7.3.1.msysgit.0

Link to comment
Share on other sites

In fact _DB_ must have proper class settings for pet in creature_template.

Current setting in code just hacks for prevent use wrong data until DB will have most cases propertly set and instead this hacks will possible add check at table loading with error reporting.

In [11410] in master added alt. fix. I will donwload soon to One also.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use