Skip to content

Commit

Permalink
[10564] Not allow charmed by player creatures have threat list.
Browse files Browse the repository at this point in the history
Original patch provided by zergtmn.
  • Loading branch information
VladimirMangos committed Sep 30, 2010
1 parent f34c593 commit 11f952b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/game/Unit.cpp
Expand Up @@ -8372,23 +8372,29 @@ void Unit::setDeathState(DeathState s)
bool Unit::CanHaveThreatList() const
{
// only creatures can have threat list
if( GetTypeId() != TYPEID_UNIT )
if (GetTypeId() != TYPEID_UNIT)
return false;

// only alive units can have threat list
if( !isAlive() )
if (!isAlive())
return false;

Creature const* creature = ((Creature const*)this);

// totems can not have threat list
if( ((Creature*)this)->isTotem() )
if (creature->isTotem())
return false;

// vehicles can not have threat list
if( ((Creature*)this)->isVehicle() )
if (creature->isVehicle())
return false;

This comment has been minimized.

Copy link
@rsa

rsa Oct 2, 2010

Contributor

It's wrong. Vehicles (not in this sources, but in principle) may have threatlist, examples - bosses Gormok the Impaler (TOC), Professor Putricide and Saurfang (ICC). This creatures is vehicles (see sniffs).

This comment has been minimized.

Copy link
@Shauren

Shauren Oct 2, 2010

Contributor

or the most obvious example: Flame Leviathan in ulduar

This comment has been minimized.

Copy link
@Laise

Laise Oct 2, 2010

Contributor

are you sure that vehicle itself has threat list and not it's controller?

This comment has been minimized.

Copy link
@technoir42

technoir42 Oct 2, 2010

Contributor

Flame Leviathan is bad example, because it always follows one particular target at time, regardless of threat levels.

This comment has been minimized.

Copy link
@rsa

rsa Oct 3, 2010

Contributor

Gormok the Impaler have 4 seats whis Cobolds, Putricide have 2 seats (tentacles, only in phase two), Saurfang have no seats. Who will manage it and how?
PS pets also must have threatlist, but this is a different story and requires a profound changes in the core...


// pets can not have a threat list, unless they are controlled by a creature
if( ((Creature*)this)->isPet() && IS_PLAYER_GUID(((Pet*)this)->GetOwnerGUID()) )
if (creature->isPet() && IS_PLAYER_GUID(((Pet const*)creature)->GetOwnerGUID()))
return false;

// charmed units can not have a threat list if charmed by player
if (creature->isCharmed() && IS_PLAYER_GUID(creature->GetCharmerGUID()))
return false;

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10563"
#define REVISION_NR "10564"
#endif // __REVISION_NR_H__

0 comments on commit 11f952b

Please sign in to comment.