aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-03-09 23:07:50 +0100
committerShauren <shauren.trinity@gmail.com>2011-03-09 23:07:50 +0100
commit3ba47e529b028b827887877fe94aa71f11a37d1d (patch)
tree62289dd39f1d0cbaccbad6733b8bb56b03b783c0
parentaaf377d983e90087c9d3ae93bf06506edcb1d395 (diff)
Core/Spells: Attempts at summoning player to an instance will result in fail if the targeted player is saved to another instance instead of summoning him at summoner's position in a different instance
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index e1f16e50be0..7124cdba558 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5331,13 +5331,20 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_BAD_TARGETS;
// check if our map is dungeon
- if (sMapStore.LookupEntry(m_caster->GetMapId())->IsDungeon())
+ MapEntry const* map = sMapStore.LookupEntry(m_caster->GetMapId());
+ if (map->IsDungeon())
{
- Map const* pMap = m_caster->GetMap();
- InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(pMap->GetId());
+ uint32 mapId = m_caster->GetMap()->GetId();
+ Difficulty difficulty = m_caster->GetMap()->GetDifficulty();
+ if (map->IsRaid())
+ if (InstancePlayerBind* targetBind = target->GetBoundInstance(mapId, difficulty))
+ if (targetBind->perm && targetBind != m_caster->ToPlayer()->GetBoundInstance(mapId, difficulty))
+ return SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE;
+
+ InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(mapId);
if (!instance)
return SPELL_FAILED_TARGET_NOT_IN_INSTANCE;
- if (!target->Satisfy(sObjectMgr->GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId()))
+ if (!target->Satisfy(sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId))
return SPELL_FAILED_BAD_TARGETS;
}
break;