mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
455a053b3d
commit
f451298784
2 changed files with 3 additions and 2 deletions
|
|
@ -9603,7 +9603,8 @@ void Unit::ClearInCombat()
|
||||||
// Player's state will be cleared in Player::UpdateContestedPvP
|
// Player's state will be cleared in Player::UpdateContestedPvP
|
||||||
if (GetTypeId() != TYPEID_PLAYER)
|
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);
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||||
|
|
||||||
clearUnitState(UNIT_STAT_ATTACK_PLAYER);
|
clearUnitState(UNIT_STAT_ATTACK_PLAYER);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8721"
|
#define REVISION_NR "8722"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue