[8722] Fixed possible creash.

Crash may happen if you try summon pet by spell and certain NPC is not in
your DB (than CreatureInfo* is NULL).

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-10-24 14:00:40 +02:00
parent 455a053b3d
commit f451298784
2 changed files with 3 additions and 2 deletions

View file

@ -9603,7 +9603,8 @@ void Unit::ClearInCombat()
// Player's state will be cleared in Player::UpdateContestedPvP
if (GetTypeId() != TYPEID_PLAYER)
{
if (((Creature*)this)->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE)
Creature* creature = (Creature*)this;
if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE)
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
clearUnitState(UNIT_STAT_ATTACK_PLAYER);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8721"
#define REVISION_NR "8722"
#endif // __REVISION_NR_H__