mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[10696] Avoid selection despawned creatures as spell autoselected targets.
Original patch provided by virusav.
This commit is contained in:
parent
d2b3981631
commit
9508001213
4 changed files with 4 additions and 4 deletions
|
|
@ -1091,7 +1091,7 @@ namespace MaNGOS
|
||||||
WorldObject const& GetFocusObject() const { return i_obj; }
|
WorldObject const& GetFocusObject() const { return i_obj; }
|
||||||
bool operator()(Creature* u)
|
bool operator()(Creature* u)
|
||||||
{
|
{
|
||||||
if(u->GetEntry() == i_entry && u->isAlive()==i_alive && i_obj.IsWithinDistInMap(u, i_range))
|
if (u->GetEntry() == i_entry && (i_alive && u->isAlive() || !i_alive && u->IsCorpse()) && i_obj.IsWithinDistInMap(u, i_range))
|
||||||
{
|
{
|
||||||
i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
|
i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -4628,7 +4628,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||||
{
|
{
|
||||||
if (pTarget->GetTypeId() == TYPEID_UNIT && pTarget->GetEntry() == i_spellST->second.targetEntry)
|
if (pTarget->GetTypeId() == TYPEID_UNIT && pTarget->GetEntry() == i_spellST->second.targetEntry)
|
||||||
{
|
{
|
||||||
if (i_spellST->second.type == SPELL_TARGET_TYPE_DEAD && pTarget->isDead())
|
if (i_spellST->second.type == SPELL_TARGET_TYPE_DEAD && ((Creature*)pTarget)->IsCorpse())
|
||||||
{
|
{
|
||||||
// always use spellMaxRange, in case GetLastRange returned different in a previous pass
|
// always use spellMaxRange, in case GetLastRange returned different in a previous pass
|
||||||
if (pTarget->IsWithinDistInMap(m_caster, GetSpellMaxRange(srange)))
|
if (pTarget->IsWithinDistInMap(m_caster, GetSpellMaxRange(srange)))
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ enum BaseModType
|
||||||
|
|
||||||
enum DeathState
|
enum DeathState
|
||||||
{
|
{
|
||||||
ALIVE = 0, // show as alive
|
ALIVE = 0, // show as alive
|
||||||
JUST_DIED = 1, // temporary state at die, for creature auto converted to CORPSE, for player at next update call
|
JUST_DIED = 1, // temporary state at die, for creature auto converted to CORPSE, for player at next update call
|
||||||
CORPSE = 2, // corpse state, for player this also meaning that player not leave corpse
|
CORPSE = 2, // corpse state, for player this also meaning that player not leave corpse
|
||||||
DEAD = 3, // for creature despawned state (corpse despawned), for player CORPSE/DEAD not clear way switches (FIXME), and use m_deathtimer > 0 check for real corpse state
|
DEAD = 3, // for creature despawned state (corpse despawned), for player CORPSE/DEAD not clear way switches (FIXME), and use m_deathtimer > 0 check for real corpse state
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10695"
|
#define REVISION_NR "10696"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue