[11445] Correct a possible crash, if caster of aura has disconnected after aura applied

A small code adjustment in addition, no need for caster at aura remove.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-05-08 19:47:59 +02:00
parent b62c7f17f0
commit 6d28c7dfd0
3 changed files with 8 additions and 6 deletions

View file

@ -8040,11 +8040,11 @@ void Aura::HandleAuraMirrorImage(bool apply, bool Real)
// Target of aura should always be creature (ref Spell::CheckCast)
Creature* pCreature = (Creature*)GetTarget();
// Caster can be player or creature, the unit who pCreature will become an clone of.
Unit* caster = GetCaster();
if (apply)
{
// Caster can be player or creature, the unit who pCreature will become an clone of.
Unit* caster = GetCaster();
pCreature->SetByteValue(UNIT_FIELD_BYTES_0, 0, caster->getRace());
pCreature->SetByteValue(UNIT_FIELD_BYTES_0, 1, caster->getClass());
pCreature->SetByteValue(UNIT_FIELD_BYTES_0, 2, caster->getGender());